Parsing & Syntax Analysis

Answer & solution
Official answer: A
Approach: Use FIRST to eliminate incompatible productions, then verify the surviving option with FOLLOW rather than stopping after a partial match.
1. T must derive ε, and its FIRST set excludes c. Since aS and bT cannot produce ε, the missing alternative is T→ε, not T→cT. This eliminates C and D.
2. FIRST(S) contains c. The existing production daT starts with d. An alternative fR would start only with f, whereas Rf starts with c when R→cTR and with f when R→ε. Thus only A has the required FIRST(S).
3. In A, S→Rf places f immediately after R, giving FOLLOW(R)={f}. R→cTR places a nullable R after T, contributing c and FOLLOW(R)'s f to FOLLOW(T).
4. The trailing T in S→daT inherits FOLLOW(S), while the trailing S in T→aS inherits FOLLOW(T). Because S is the start symbol, $ propagates to both sets. The result is exactly {c,f,$} for each.
Answer: A. FIRST describes how derived strings begin; FOLLOW describes terminals that can occur immediately after a nonterminal in a sentential form.