Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2024 Set 1
Questions

Q28

MCQ2 marks, −0.67Compiler design

Consider the following grammar GG, with SS as the start symbol. The grammar GG has three incomplete productions denoted by (1),(2)(1), (2), and (3)(3).

S→daT∣(1)T→aS∣bT∣(2)R→(3)∣ϵ\begin{aligned} & S \rightarrow d a T \mid \quad(1) \\ & T \rightarrow a S|b T| \quad(2) \\ & R \rightarrow(3) \mid \epsilon\end{aligned}

The set of terminals is {a,b,c,d,f}\{a, b, c, d, f\}. The FIRST and FOLLOW sets of the different non-terminals are as follows. FIRST⁡(S)={c,d,f},FIRST⁡(T)={a,b,ϵ},FIRST⁡(R)={c,ϵ}FOLLOW⁡(S)=FOLLOW⁡(T)={c,f,$},FOLLOW⁡(R)={f}\begin{aligned} & \operatorname{FIRST}(S)=\{c, d, f\}, \operatorname{FIRST}(T)=\{a, b, \epsilon\}, \operatorname{FIRST}(R)=\{c, \epsilon\} \\ & \operatorname{FOLLOW}(S)=\operatorname{FOLLOW}(T)=\{c, f, \text{\textdollar}\}, \operatorname{FOLLOW}(R)=\{f\}\end{aligned} Which one of the following options CORRECTLY fills in the incomplete productions?

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.