Parsing questions

Q13

GATE CS 2022 CSParsingMCQ1 mark−1/3 if wrong
Which one of the following statements is TRUE?
Show answer without attempting

Answer: D

Q29

GATE CS 2022 CSParsingNAT1 mark
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.
Show answer without attempting

Answer: 5

0/20 correct0 marks

Related topics in Compiler Design