Assignment 0656643
Assignment 0656643
Assignment 0656643
Assignment-6 (Week 6)
Q1. In the name “LR Parser”, the ‘L’ and ‘R’ stands for:
(A) Left-to-right scanning and constructing a Rightmost Derivation in Reverse
(B) Left-to-right scanning and constructing a Rightmost Derivation
(C) Left to right reduction
(D) None of the other options
Ans: A
Ans: D
Ans: A
Ans: D
Q5. Consider the following grammar:
S→L=R
S→R
L→*R
L → id
R→L
Consider the set of LR(0) items and let I2 is as given below:
S → L .=R
R → L.
The entry in ACTION[2, =] is:
(A) Shift to some state
(B) Reduce using some production
(C) A shift-reduce conflict
(D) None of the above
Ans: C
Q6. In LR(1) parsing, we reduce by A → α only on those input symbols a for which [A → α., a] is
an LR(1) item in the state on top of the stack. The set of such a’s will always be:
(A) Equal to the set FOLLOW(A)
(B) A subset of FOLLOW(A)
(C) A proper subset of FOLLOW(A)
(D) None of the above
Ans: B
Ans: D
Ans: B
Ans: A