GATE Computer ScienceEasyGATE CS (PYQ pattern)

How many distinct LR(0) items does the grammar E → T E'; E' → + T E' | ε; T → F T'; T' → * F T' | ε; F → ( E ) | id have (do not augment it; an ε-production gives exactly one item)?

  1. A. 24
  2. B. 22
  3. C. 14
  4. D. 25

Correct answer: B. 22

A production with right side of length m gives m + 1 items (dot positions); summing over the 8 productions gives 22.

More Compiler Design questions

Exams that ask this topic