Computer Science EngineeringHardISRO SC
For the grammar E -> E+T | T; T -> T*F | F; F -> (E) | id, how many total LR(0) items (all dotted positions over all productions, excluding the augmented rule) exist?
- A. 19
- B. 18
- C. 17
- D. 20
Correct answer: B. 18
A production with rhs length k has k+1 items (an epsilon production has 1): total 18.
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 -> 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)…
- Consider the grammar S -> aSb | SS | ab. In its SLR(1) parsing table, the number of states with a conflict (reduce lookaheads restricted…