GATE Computer ScienceEasyGATE CS (PYQ pattern)

For the grammar S → a A | A b; A → c | ε, what is FOLLOW(A)?

  1. A. {$, b}
  2. B. {b}
  3. C. {$}
  4. D. {$, a, b}

Correct answer: A. {$, b}

From S → a A, FOLLOW(A) gets FOLLOW(S) = {$}; from S → A b it gets b. So FOLLOW(A) = {b, $}.

More Compiler Design questions

Exams that ask this topic