Consider the augmented grammar with{+, *, (, ), id } as the set of terminals.
S' → S
S → S + R | R
R → R * P | P
P → (S) | id
If I0is the set of two LR(0) items {[S' → S.], [S → S. + R]}, then goto(closure(I0),+) contains exactly _____items.
Correct Answer:
5
Solution:
goto(closure(I0),+) is
S → S+.R
R → .R * P
R → .P
P → .(S)
P → .id
goto(closure(I0),+) will contain exactly 5 elements.