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

Discussion

Given productions S goes to aAb and A goes to c or epsilon, FOLLOW(A) is

  • A.the set containing c alone
  • B.the set containing both a and b
  • C.the set containing b alone
  • D.the set containing a alone

Answer: C

A appears in the right side aAb followed immediately by the terminal b, so FIRST of what follows A is simply b. Nothing else can follow A anywhere in this grammar. Small grammars like this one are worth working through by hand until the rule is automatic.

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

Post your comment

Please log in or register to post a comment.