A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

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

X -> c.X, c/d
X -> .cX, c/d
X -> .d, c/d
X -> c.X, $
X -> .cX, $
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.
a. 1 only
b. 2 only
c. 1 and 4 only
d. 1, 2, 3, and 4
Answer:1, 2, 3, and 4

Similar Questions:



View All Questions on: Compiler Design


Start The Conversation: