GATE CSE 2026 Session 2 Q41: Shift-reduce conflicts in the LR(0) table of a grammar
- Compiler Design
- 2 marks
- MCQ
- −2/3 if wrong
Question
Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol.
Which one of the following options gives the number of shift-reduce conflicts that will occur in the ACTION table?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2026 final answer key)
Concept used: In LR(0), a complete item forces a reduce on every terminal, clashing with any shift in the same state.
First step: Build the LR(0) item sets; states containing or or alongside shift items are the conflict candidates, counted per terminal entry.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2026 Session 2 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Compiler Design PYQs
- 2026 Session 1 · Q27Classify errors in three C string declarations
- 2026 Session 1 · Q28True statements about LL(1) parsing
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG
- 2026 Session 1 · Q53Compare two SDDs for type declarations
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string
- 2026 Session 2 · Q45Live variables at the exit of each block in a loop CFG