MCQ
Q.
Consider the following grammar G.
S2: All strings generated by G can be parsed with help of LR (1).
S ? F ? H
F ? p ? c
H ? d ? cWhich one is true?S1: All strings generated by G can be parsed with help of LL (1).S2: All strings generated by G can be parsed with help of LR (1).
Correct Answer: D
There is ambiguity as the string can be derived in 2 possible ways.
First Leftmost Derivation
S ? F
F ? c
Second Leftmost Derivation
S ? H
H ? c.