The grammar whose productions are <stmt> → if id then <stmt> <stmt> → if id…
PYQ GATE 1996
The grammar whose productions are
<stmt> → if id then <stmt>
<stmt> → if id then <stmt> else <stmt>
<stmt> → id := id
is ambiguous because
- A.
the sentence if a then if b then c:= d has two parse trees
- B.
the left most and right most derivations of the sentence if a then if b then c:= d give rise to different parse trees
- C.
the sentence if a then if b then c:= d else c:= f has more than two parse trees
- D.
the sentence if a then if b then c:= d else c:= f has two parse trees
Attempted by 151 students.
Sign up free to check your answer
Sign up freeLoading lesson…

