Professional Documents
Culture Documents
ASSIGNMENT-2
QUESTION 1
QUESTION-2
QUESTION-3
QUESTION-4
QUESTION-5
What is Shift-Reduce and Reduce-Reduce conflict? How these can be resolved? With
examples explain in which condition S-R and R-R conflict can occur in SLR, canonical
LR and LALR parsers. (Make use of LR (0), LR (1) items).
QUESTION-6
{
Int i = 1;
Int a[10];
While (i <= 10)
{
a[i] = 0;
i = i + 1;
}
}
QUESTION-7
QUESTION-8
QUESTION-9
(a)
S -> cA / ccB
A -> cA / a
B -> ccB / b
(b)
Question-10
S -> B
B -> begin DA end
D -> Dd; / €
A -> A; E / €
E -> B / S
Question-11