Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts, if and only, if
    1. the SLR (1) parser for G has S-R conflicts
    2. the LR (1) parser for G has S-R conflicts
    3. the LR (0) parser for G has S-R conflicts
    4. the LALR (1) parser for G has reduce-reduce conflicts
Correct Option: B

LALR parser is reduced form of CLR or LR(1) parser, LALR parser uses the LR(1) items of CLR parser & of any shift reduce conflicts are there then it is due to LR(1) parser.



Your comments will be displayed only after manual approval.