GATE Computer ScienceHardGATE CS (PYQ pattern)

Construct the SLR(1) parsing table of S → a S b S | b S a S | ε (augmented). In how many states of the SLR(1) automaton does the ACTION part have at least one conflicting cell?

  1. A. 7
  2. B. 2
  3. C. 6
  4. D. 5

Correct answer: D. 5

Using FOLLOW sets as reduce lookaheads, 5 states contain a multiply-defined ACTION cell (10 cells in all).

More Compiler Design questions

Exams that ask this topic