MCQ · 2 marks · Context Free Languages

GATE CS 2024 CS-1 — Q38

Consider the following grammar GG, with SS as the start symbol. The grammar GG has three incomplete productions denoted by (1), (2), and (3).
S→daT∣(1)S \to daT \mid (1)
T→aS∣bT∣(2)T \to aS \mid bT \mid (2)
R→(3)∣ϵR \to (3) \mid \epsilon
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,ϵ}\text{FIRST}(S) = \{c, d, f\}, \text{FIRST}(T) = \{a, b, \epsilon\}, \text{FIRST}(R) = \{c, \epsilon\}
FOLLOW(S)=FOLLOW(T)={c,f,$},FOLLOW(R)={f}\text{FOLLOW}(S) = \text{FOLLOW}(T) = \{c, f, \$\}, \text{FOLLOW}(R) = \{f\}
Which one of the following options CORRECTLY fills in the incomplete productions?
Select one option