Draw parse trees for the given expressions using the following grammar. Note that [number] is a terminal that has a numeric value.

[E] -] [E] + [T]
| [E] – [T]
| [T]

[T] -] [T] * [F]
| [T] / [F]
| [F]

[F] -] [number] | ( [E] )
  • 2 + 3 * 5
  • 2 + (3 * 5)

What does the following grammar produce? Describe the list. How many elements will such a list have? Does anything appear after the elements or in-between the elements?

Note that [empty], [number], and [identifier] are terminals defined as follows: [empty] is an empty string, [number] is a numeric value, and [identifier] is like an identifier name in C/Java.

[constants] -] [const-decl] | [empty]
[const-decl] -] const [name] = [constant];
| [const-decl] [name] = [constant];
[constant] -] [number]
[name] -] [identifier]

Convert the following EBNF to BNF.

S -> A { bA }
A -> a [b]A

Prove that the following grammar is ambiguous.

[S] -] [A]
[A] -] [A] + [A] | [id]
[id] -] a | b | c
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.