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

Discussion

FOLLOW sets are computed after FIRST sets because

  • A.neither computation depends in any way upon the other one
  • B.FOLLOW sets are only needed when the grammar is ambiguous
  • C.the FOLLOW computation uses FIRST of the symbols following a nonterminal
  • D.the FIRST computation uses the FOLLOW of every nonterminal involved

Answer: C

Whatever follows a nonterminal contributes its FIRST set to that nonterminal's FOLLOW. The dependency runs one way only, which fixes the order in which the two must be computed. Attempting the reverse order produces sets that are silently incomplete.

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

Post your comment

Please log in or register to post a comment.