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

Discussion

In a context free grammar, the left hand side of every production is

  • A.a single terminal symbol drawn from the token set
  • B.either a terminal or a nonterminal without restriction
  • C.a single nonterminal symbol
  • D.a string of terminals and nonterminals of any length

Answer: C

Correct answer: a single nonterminal symbol

This restriction is what makes the grammar context free: a nonterminal may be replaced by its right side wherever it occurs, without regard to what surrounds it. Allowing a string on the left would give a context sensitive grammar, for which no efficient general parsing algorithm exists.

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

Post your comment

Please log in or register to post a comment.