Computer Science EngineeringVery hardISRO SC
Consider the grammar E -> E+T | T; T -> T*F | F; F -> (E) | id. The canonical LR(0) collection (with the augmented production S' -> start symbol) has how many states?
- A. 13
- B. 11
- C. 14
- D. 12
Correct answer: D. 12
Build closure and goto sets from {S' -> .S}; the automaton has 12 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
- For the grammar E -> E+T | T; T -> TF | F; F -> (E) | id, how many total LR(0) items (all dotted positions over all productions, excluding…
- Consider the grammar S -> AB; A -> aA | a; B -> bB | b. The canonical LR(0) collection (with the augmented production S' -> start symbol)…
- 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)…