Consider the context-free grammar: E → E + E E → (E * E) E → idHere E is the…
GATE · 2005 · IT
Consider the context-free grammar:
E → E + E
E → (E * E)
E → idHere E is the starting symbol, the terminals are {id, (, +, ), *}, and the only nonterminal is E.
Which of the following terminal strings has more than one parse tree when parsed according to the above grammar?
- A.
id + id + id + id
- B.
id + (id* (id * id))
- C.
(id* (id * id)) + id
- D.
((id * id + id) * id)
Attempted by 219 students.
Sign up free to check your answer
Sign up freeLoading lesson…