GATE Computer ScienceHardGATE CS (PYQ pattern)

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

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

Correct answer: D. 2

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

More Compiler Design questions

Exams that ask this topic