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

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

Power increases from LL(0) to LR(0), SLR(1), LALR(1) and finally canonical LR(1), which is the most powerful of these.

More Theory of Computation and Compilers questions