GATE CS 2026 Set 2 | Question 29

Compiler Design › Parser · MSQ · 1 mark · Answer: B, C

  1. Question 29Compiler Designmsq1 mark
    Which 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.

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 →