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

  1. A. 2
  2. B. 3
  3. C. 1
  4. 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.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic