Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship between n1 and n2 is
    1. n1 is necessarily less than n2
    2. n1 is necessarily equal to n2
    3. n1 is necessarily greater than n2
    4. None of these
Correct Option: B

SLR parser is less range of context free languages than LALR but still both n1 & n2 are same for SLR & LALR respectively. Hence (b) is correct option.



Your comments will be displayed only after manual approval.