Arrange the following parsers in increasing order of their power of handling grammars, i.e. from the least powerful parser to the most powerful parser.
A. LR(0)
B. LR(1)
C. LALR(1)
D. LL(0)
E. SLR
Choose the correct answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. LL(0) → LR(0) → SLR → LALR(1) → LR(1)
Explanation
Among these, LL(0) is the weakest; among LR parsers, LR(0) ⊂ SLR(1) ⊂ LALR(1) ⊂ LR(1) (canonical LR(1) is the most powerful).More Theory of Computation and Compilers questions
- What are the various LEADERS (leading statements) for the TAC given in the passage?
- Which of the following is the optimized version of the TAC given in the passage?
- Which of the following is the correct high level code for the TAC given in the passage?
- What blocks do Block 3 and Block 5 dominate in the flow graph for the TAC given in the passage? (Basic blocks: B1 = 100–102, B2 = 103, B3 =…
- Which of the following is the correct flow graph (adjacency matrix of basic blocks B1–B7, row → column means an edge) for the TAC given in…
- Which of the following is TRUE about the Pumping Lemma for regular languages?