MCQ · 2 marks · Parsing

GATE CS 2013 CS — Q40

Consider the following two sets of LR(1) items of an LR(1) grammar.

<br>X→c⋅X,c/dX→c⋅X,$<br>X→⋅cX,c/dX→⋅cX,$<br>X→⋅d,c/dX→⋅d,$<br>\begin{array}{ll}<br>X \to c\cdot X, c/d & X \to c\cdot X, \$ \\<br>X \to \cdot cX, c/d & X \to \cdot cX, \$ \\<br>X \to \cdot d, c/d & X \to \cdot d, \$<br>\end{array}

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 cc will lead to two different sets.
Select one option