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

Discussion

LALR parsing is constructed by

  • A.removing states from the canonical collection at random
  • B.merging canonical LR(1) states that share the same core
  • C.discarding the lookaheads from canonical LR(1) items entirely
  • D.adding lookaheads to the SLR table after it has been built

Answer: B

The merge cuts the table to the size of the SLR table while retaining most of the precision of canonical LR. It is the construction that Yacc and Bison implement. That choice has shaped how language grammars have been written for decades.

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

Post your comment

Please log in or register to post a comment.