GATE Computer ScienceVery hardNIELIT Scientist B

For E → E + T | T; T → T * F | F; F → ( E ) | id, how many LR(0) states have a conflict that is resolved by the SLR(1) FOLLOW-set check (conflicts in LR(0), none in SLR(1))?

  1. A. 3
  2. B. 1
  3. C. 4
  4. D. 2

Correct answer: D. 2

The states containing E → T . with T → T . * F, and E → E + T . with T → T . * F, are LR(0) shift-reduce conflicts; since * is not in FOLLOW(E), SLR(1) resolves both. SLR conflicts: 0.

More Compiler Design questions

Exams that ask this topic