NAT · 1 mark · Parsing

GATE CS 2022 CS — Q29

Consider the augmented grammar with {+,∗,(,),id}\{+, *, (, ), \text{id}\} as the set of terminals.

S′→SS' \to S
S→S+R∣RS \to S + R \mid R
R→R∗P∣PR \to R * P \mid P
P→(S)∣idP \to (S) \mid \text{id}

If I0I_0 is the set of two LR(0)LR(0) items {[S′→S∙],[S→S∙+R]}\bigl\{[S' \to S\bullet], [S \to S\bullet + R]\bigr\}, then goto(closure(I0),+)\text{goto}(\text{closure}(I_0), +) contains exactly __________ items.