GATE CS 2026, set 2 · Question 41 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Consider the canonical LR(0) parsing of the grammar below using terminals {a, b, c} and non-terminals {A, B, C, S} with S as the start symbol.
S → ACBA → aA | εC → cC | εB → bB | b
Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0) ACTION table?

  1. (A) 2
  2. (B) 3
  3. (C) 4
  4. (D) 5
Answer

Answer (D)

Answer from the official GATE CS 2026 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes