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

Discussion

Consider the following statements about FIRST and FOLLOW.
1. Epsilon may belong to a FIRST set.
2. The end of input marker may belong to a FOLLOW set.
3. Epsilon may belong to a FOLLOW set.

  • A.3 only
  • B.1 only
  • C.All of them
  • D.1 and 2 only

Answer: D

Correct answer: 1 and 2 only

Statements 1 and 2 are correct: epsilon belongs to the FIRST set of anything that can derive the empty string, and the end of input marker belongs to the FOLLOW set of the start symbol. Statement 3 is wrong - a FOLLOW set contains terminals and the end marker, and epsilon is not something that can follow a symbol.

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

Post your comment

Please log in or register to post a comment.