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

Discussion

Given productions S goes to AB, A goes to a or epsilon and B goes to b, FIRST(S) is

  • A.the set containing a alone
  • B.the set containing b alone
  • C.the set containing a, b and epsilon
  • D.the set containing a and b

Answer: D

S begins with A, which contributes a. Because A can also derive epsilon, FIRST of B contributes b as well. Epsilon is not included since S itself cannot derive the empty string. Tracking when epsilon propagates is the part most often got wrong by hand.

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

Post your comment

Please log in or register to post a comment.