Multiple choice

Number of states for a grammar in SLR parser and LALR is

  1. double of the other

  2. somewhat dependent on each other

  3. independent

  4. dependent on grammar

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

LALR parsers offer many of the advantages of SLR and canonical - LR parsers, by combining the states that have the same kernels (sets of items, ignoring the associated look ahead sets). In this, the number of states is the same or that of the SLR parser.