Question: The grammar below is ambiguous: E E + E | E * E | (E) | a | b (a) Extend this grammar to include
The grammar below is ambiguous: E E + E | E * E | (E) | a | b
(a) Extend this grammar to include subtraction (-) and exponentiation ( ). (b) Is this grammar ambiguous? If so give two different parse trees for some yield.
(c) Construct an unambiguous grammar for your extended grammar. Make sure the precedence and associativity is as we would expect.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
