GATE Computer ScienceEasyGATE CS (PYQ pattern)

S → a S | b S | c is LR(0). In its LR(0) parsing table the reduce action for a complete item is written in every terminal column including $. How many reduce entries does the ACTION table contain (accept excluded)?

  1. A. 3
  2. B. 9
  3. C. 14
  4. D. 12

Correct answer: D. 12

There are 3 states with a completed item (none mixes shift and reduce); each contributes 3+1 = 4 terminal columns, so 12.

More Compiler Design questions

Exams that ask this topic