Computer Science EngineeringHardISRO SC

For the grammar E -> E+T | T; T -> T*F | F; F -> (E) | id, how many total LR(0) items (all dotted positions over all productions, excluding the augmented rule) exist?

  1. A. 19
  2. B. 18
  3. C. 17
  4. D. 20

Correct answer: B. 18

A production with rhs length k has k+1 items (an epsilon production has 1): total 18.

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

Exams that ask this topic