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

Discussion

Which of the following is the most powerful parring method ?

  • A.LL(I)
  • B.Canonical LR
  • C.SLR
  • D.LALR

Answer: B

Canonical LR is the most powerful parsing method of those listed. It keeps a full look-ahead symbol with each item, so it can parse every deterministic context-free grammar, with the largest set of states and the most precise reductions.

LL(1) is a top-down method and handles a smaller class of grammars, SLR uses the follow sets and so makes more conflicts, and LALR merges states of canonical LR with the same core, which can only add reduce-reduce conflicts. So the order of power is SLR, then LALR, then canonical LR.

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

Post your comment

Please log in or register to post a comment.