Q1) (8%) Show a leftmost derivation step by step (each step on a single line)
for the statement: A = A + B * C using the following grammar:
<assign> --> <id> = <expr>
<expr> --> <id> + <expr> |
<id> * <expr> | <id>
<id> --> A
| B | C
Q2) (6%) Is this grammar ambiguous (Yes or No?) Justify your answer.
Q3) (6%) Does this grammar enforce the precedence of the conventional operators (Yes or No?) Justify your answer.
Get Answers For Free
Most questions answered within 1 hours.