All mock tests are FREE till 31 December — register to save your progress

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