Machine-translated by Google. Questions are authored in English.
Top

Discussion

If FIRST of a right side contains epsilon, the FOLLOW computation must also

  • A.remove epsilon from every FOLLOW set in the grammar
  • B.report that the grammar cannot be LL(1) as written
  • C.add epsilon to the FOLLOW set belonging to the left side nonterminal
  • D.add FOLLOW of the left side nonterminal to the FOLLOW of that symbol

Answer: D

Correct answer: add FOLLOW of the left side nonterminal to the FOLLOW of that symbol

If everything after a symbol in a right side can vanish, then whatever may follow the left side may follow that symbol too. This propagation rule is what makes FOLLOW computation iterative, since adding to one FOLLOW set may require additions to others until nothing changes.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.