GATE Computer ScienceModerateNIELIT Scientist B

For the standard expression grammar E → T E′; E′ → + T E′ | ε; T → F T′; T′ → * F T′ | ε; F → ( E ) | id, how many symbols (including $) are in FOLLOW(T′)?

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

Correct answer: C. 3

FOLLOW(T′) = FOLLOW(T) = {+, ), $} (T is followed by E′, which is nullable), so 3.

More Compiler Design questions

Exams that ask this topic