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

Discussion

The class of grammars parsed by LR methods, compared with LL methods, is

  • A.strictly smaller, since LR requires more restrictive grammars
  • B.exactly the same class expressed in two different notations
  • C.incomparable, with neither class containing the other
  • D.strictly larger, so every LL(1) grammar is also LR(1)

Answer: D

LR parsers postpone the decision until a whole right side has been seen, so they cope with grammars LL parsers cannot. Every LL(1) grammar is LR(1) but not conversely. The extra power is why parser generators overwhelmingly favour the LR family.

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

Post your comment

Please log in or register to post a comment.