Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Consider the following two sets of LR(1) items of an LR(1) grammar.
    X → c.X, c/d X → c.X, $
    X → .cX, c/d X → .cX, $
    X → .d, c/d X → .d, $

    Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are false?
    1. Cannot be merged since look aheads are different.
    2. Can be merged but will result in S-R conflict.
    3. Can be merged but will result in R-R conflict.
    4. Cannot be merged since goto on c will lead to two different sets.
    1. 1 only
    2. 2 only
    3. 1 and 4 only
    4. All of these
Correct Option: D

NA



Your comments will be displayed only after manual approval.