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?
GATE CSE 2026Compiler Design › Grammars & ParsingVerified
(D) 5 5 5
Construct the canonical LR(0) collection for the augmented grammar and mark every state where a completed item (reduce) and an item with a terminal after the dot (shift) coexist. Count each conflicting terminal action.
The canonical LR(0) collection has five states with a shift-reduce conflict: I0, I1, I2, I4, and I7. Counting the conflicting terminal actions gives 5, so option D is correct.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.