Computer Science EngineeringVery hard

How many states does the LR(0) automaton (canonical collection of item sets, including the augmented production) have for the grammar S -> aS | b?

  1. A. 4
  2. B. 5
  3. C. 6
  4. D. 7

Correct answer: B. 5

The sets are I0, goto on S, a, b, and goto from the a-state on S, with a looping back to itself, giving 5 states.

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

Exams that ask this topic