Computer Science EngineeringHardISRO SC
Consider the grammar S -> AB; A -> aA | a; B -> bB | b. The canonical LR(0) collection (with the augmented production S' -> start symbol) has how many states?
- A. 9
- B. 7
- C. 10
- D. 8
Correct answer: D. 8
Build closure and goto sets from {S' -> .S}; the automaton has 8 states.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- Consider the grammar S -> aAd | bBd | aBe | bAe; A -> c; B -> c. The canonical LR(0) collection (with the augmented production S' -> start…
- Consider the grammar E -> E+E | EE | id. In its LR(0) automaton (augmented grammar), how many states contain a shift/reduce or…
- Consider the grammar S -> iSeS | iS | a. In its LR(0) automaton (augmented grammar), how many states contain a shift/reduce or…
- Consider the grammar L -> L , S | S; S -> id | ( L ). The canonical LR(0) collection (with the augmented production S' -> start symbol)…
- Consider the grammar S -> aSb | SS | ab. In its SLR(1) parsing table, the number of states with a conflict (reduce lookaheads restricted…
- Consider the grammar S -> A a | b A c | d c | b d a; A -> d. The number of terminals (including the end marker ) in FOLLOW(A) is