GATE Computer ScienceEasyGATE CS (PYQ pattern)

S → C C; C → c C | d 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. 6
  3. C. 9
  4. D. 11

Correct answer: C. 9

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

More Compiler Design questions

Exams that ask this topic