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

Discussion

ANTLR uses a parsing strategy best described as

  • A.a precedence relation table applied to expression grammars
  • B.canonical LR(1) in which no states at all are merged together
  • C.adaptive LL with arbitrary lookahead decided at parse time
  • D.the merged table construction that Yacc and Bison both use

Answer: C

Correct answer: adaptive LL with arbitrary lookahead decided at parse time

ANTLR uses ALL(*), which resolves a decision by simulating the alternatives against the actual remaining input, using as much lookahead as that particular decision needs. This accepts far more grammars than LL(1) while keeping the readability of a recursive descent parser, and it caches the decisions so the cost is paid once.

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

Post your comment

Please log in or register to post a comment.