Skip to content
GATEiit

GATE CSE 2026 Session 2 Q41: Shift-reduce conflicts in the LR(0) table of a grammar

Question

Consider the canonical LR(0)LR(0) parsing of the grammar below using terminals {a,b,c}\{a, b, c\} and non-terminals {A,B,C,S}\{A, B, C, S\} with SS as the start symbol.

S→ACBA→aA∣ϵC→cC∣ϵB→bB∣b\begin{aligned} S &\rightarrow ACB \\ A &\rightarrow aA \mid \epsilon \\ C &\rightarrow cC \mid \epsilon \\ B &\rightarrow bB \mid b \end{aligned}

Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0)LR(0) ACTION table?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
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 A→⋅A \rightarrow \cdot or C→⋅C \rightarrow \cdot or B→b⋅B \rightarrow b\cdot 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

WhatsAppDownload image

Source: official GATE 2026 Session 2 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key