GATE Computer ScienceVery hardGATE CSE

For the standard expression grammar E → E + T | T; T → T * F | F; F → ( E ) | id (augmented), how many states does the canonical LR(1) automaton have, and by how many does LALR(1) reduce it?

  1. A. 22 states, reduced by 8
  2. B. 22 states, reduced by 10
  3. C. 12 states, reduced by 10
  4. D. 24 states, reduced by 10

Correct answer: B. 22 states, reduced by 10

LR(0)/LALR have 12 states; the canonical LR(1) automaton has 22, so merging removes 10.

More Compiler Design questions

Exams that ask this topic