GATE Computer ScienceEasyGATE CS (PYQ pattern)

How many distinct LR(0) items does the grammar S → i E t S Z | a; Z → e S | ε; E → b have (do not augment it; an ε-production gives exactly one item)?

  1. A. 16
  2. B. 9
  3. C. 13
  4. D. 14

Correct answer: D. 14

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

More Compiler Design questions

Exams that ask this topic