Computer Science EngineeringHardISRO SC
Consider the grammar S -> iSeS | iS | a. In its LR(0) automaton (augmented grammar), how many states contain a shift/reduce or reduce/reduce conflict when reduce actions are placed under every terminal?
- A. 2
- B. 3
- C. 1
- D. 4
Correct answer: C. 1
Inspect each state: a complete item together with a shift item or another complete item is an LR(0) conflict. Count = 1.
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 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
- Consider the grammar S -> a S b | epsilon. The number of terminals (including the end marker ) in FOLLOW(S) is
- For the grammar S -> A b | B c; A -> a A | epsilon; B -> a B | d, how many total LR(0) items (all dotted positions over all productions…
- Consider the grammar S -> A b | B c; A -> a A | epsilon; B -> a B | d. Is the grammar LL(1)? If so the predictive parse table has how many…