Site navigation

Arrange the following parsers in increasing order of their power of handling grammars i.e. from the…

Parsing power increases as LL(0), LR(0), SLR(1), LALR(1), LR(1). LR(0) uses no lookahead, SLR adds FOLLOW sets, LALR(1) uses lookaheads from merged LR(1) states, and…

Choose your answer

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

Select one answer
Answer and explanation

Correct answer C

Parsing power increases as LL(0), LR(0), SLR(1), LALR(1), LR(1). LR(0) uses no lookahead, SLR adds FOLLOW sets, LALR(1) uses lookaheads from merged LR(1) states, and canonical LR(1) keeps full lookahead sets in its items, so it handles the largest class of grammars. Merging LR(1) states with the same core can introduce reduce-reduce conflicts, so LALR(1) is weaker than LR(1), not stronger.

Practice for these exams

  • UGC NET Computer Science and Applications

Related question papers

Related exam syllabi

Related questions in this topic