Syntax Analysis questions

Q3

GATE CS 2019 CSParsingMCQ1 mark−1/3 if wrong
Which one of the following kinds of derivation is used by LR parsers?
Show answer without attempting

Answer: D

Q19

GATE CS 2019 CSParsingNAT1 mark
Consider the grammar given below:
S→AaS \to Aa
A→BDA \to BD
B→b∣ϵB \to b \mid \epsilon
D→d∣ϵD \to d \mid \epsilon

Let a,b,d,a, b, d, and $\$ be indexed as follows:
abd$\$
3210
Compute the FOLLOW set of the non-terminal BB and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a,b,d,$}\{a, b, d, \$\}, then the answer should be 3210)
Answer: __________.
Show answer without attempting

Answer: 31

Q43

GATE CS 2019 CSParsingNAT2 marks
Consider the augmented grammar given below:
S′→SS' \to S
S→(L)∣idS \to (L) \mid \text{id}
L→L,S∣SL \to L, S \mid S

Let I0=CLOSURE({[S′→∙S]})I_0 = \text{CLOSURE}(\{[S' \to \bullet S]\}). The number of items in the set GOTO(I0,()\text{GOTO}(I_0, \text{(}) is: __________.
Show answer without attempting

Answer: 5

0/30 correct0 marks