Computer Science EngineeringHardISRO SC
Consider the grammar S -> aSb | SS | ab. In its SLR(1) parsing table, the number of states with a conflict (reduce lookaheads restricted to FOLLOW sets) is
- A. 2
- B. 3
- C. 1
- D. 4
Correct answer: C. 1
A reduce A -> a. is placed only under FOLLOW(A); count states where this still collides with a shift or another reduce: 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 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…
- Three-address code: 1: x1 = x2 + 1; 2: x2 = x3 + 2; 3: x3 = x1 + 3; 4: x1 = x2 + 4; 5: x2 = x3 + 5; 6: goto 8; 7: x1 = x2 + 7; 8: if x1 <…
- Using Sethi-Ullman labelling (a left leaf needs 1 register, a right leaf operand can be a memory operand and needs 0), the minimum number…