Computer Science EngineeringVery hardISRO SC

Consider the grammar E -> E+T | T; T -> T*F | F; F -> (E) | id. The canonical LR(0) collection (with the augmented production S' -> start symbol) has how many states?

  1. A. 13
  2. B. 11
  3. C. 14
  4. D. 12

Correct answer: D. 12

Build closure and goto sets from {S' -> .S}; the automaton has 12 states.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic