GATE CS 2026 Set 2 | Question 29
Compiler Design › Parser · MSQ · 1 mark · Answer: B, C
- Question 29Compiler Designmsq1 markWhich of the following grammars is/are ambiguous?
- A.
- B.✓
- C.✓
- D.
Answer: B, C
Solution
Answer: (B), (C) - (A) generates with a unique derivation — unambiguous. - (B) the classic expression grammar has two parse trees for — ambiguous ✓ - (C) generates but a string like has multiple leftmost derivations (via then , or then ) — ambiguous ✓ - (D) right-linear, unique derivation for each — unambiguous. - A.
More GATE PYQ on Parser
All GATE CS Compiler Design PYQ →Attempt GATE CS 2026 Set 2 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →