GATE 2025 CS (CS1) – Question 46
Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) For a production $A \rightarrow \epsilon$, $\epsilon$ will be added to $First(A)$.; (D) If there is any input right end marker, it will be added to $Follow(S)$, where $S$ is the start symbol.
Explanation
A→ε puts ε in First(A). The end marker $ is placed in Follow(S) for the start symbol. ε is never in a Follow set, and $ is not added to First.