Create a new grammar for the same language

Assignment Help Computer Engineering
Reference no: EM131772554

Assignment

Part 1:

A logical grammar defines logical expressions. You are given the following CGF for Boolean Logic. The terminal symbols are ∑ = { (, ),¬, ∧, ∨, 0, 1}

A→ A ∨ A                        (1)
A→ A ∧ A                        (2)
A→ ¬A                            (3)
A→ (A)                            (4)
A→ 0|1                            (5)

a) Generate by hand the parse tree for the follovving expressions

1 ∨ 1 ¬ 1
(1 ∧ ¬ 0) ∨ ¬ 0
((¬1 ∨ 0) ∧ 0) ∨(0 ∧ (¬1))

b) Show that the grammar is ambiguous by building two parse trees for the same string.

c) Create a new grammar for the same language so that it is unambiguous. The operators are listed in ascending order of precedence in the above rules. The binary operators should be left-associative

Part 2: Building a parser for Boolean Logic Expressions:

a. Your unambiguous grammar is probably left recursive and cannot be implemented using recursive descent parsing. Rewrite the grammar so that it is not left recursive and can be used directly for top-down parsing with Al) terminal look-ahead

b. Implement your unambiguous, non-left recursive gramrnar using either the recursive descent or the table-driven method.

Reference no: EM131772554

Questions Cloud

Perhaps no riskier than most investments : Do you think they are a solid investment for your retirement, perhaps no riskier than most investments? Or do they deserve the derogatory term "junk"?
Venture sustainable growth rate : Use the following information to estimate a venture's sustainable growth rate: Net income = $200,000; Total assets = $1,000,000; equity multiple based
Proportion of americans who fit the description : Parade Magazine reported that "nearly 3200 readers dialed a 900 number to respond to a survey in our Jan. 8 cover story on America's young people and violence".
Would your bond sell for a premium or a discount : The market interest rates for like securities rose to 5%. Would your bond sell for a premium or a discount? Why?
Create a new grammar for the same language : Create a new grammar for the same language so that it is unambiguous. The operators are listed in ascending order of precedence in the above rules.
How many years are there until the bond? matures : The bond pays annual coupons with a coupon rate of 3?% and the next coupon is due in one year. The bond has a yield to maturity of 8.75?%.
Computing the confidence interval for the results : Find the results of a poll reported in a weekly newsmagazine such as Newsweek or Time, in a newspaper such as the New York Times.
Operating activities using the indirect method : Calculate the cash provided (used) in operating activities using the indirect method.
Prepare a business plan - explorer travel & tours : Prepare a Business Plan on Explorer Travel - Tours and Present full cash flow chart based on your market targets for the first 12 months and for the second year

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd