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

Discussion

The following all prevent a grammar from being LL(1) EXCEPT

  • A.ambiguity in the grammar as written
  • B.right recursion in one of the productions
  • C.a rule that recurses upon itself at its leftmost position
  • D.two alternatives sharing a common prefix

Answer: B

Left recursion, common prefixes and ambiguity each create a table conflict. Right recursion is perfectly acceptable and is in fact what left recursion elimination produces. Bottom up parsers by contrast prefer left recursion for exactly the opposite reason.

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

Post your comment

Please log in or register to post a comment.