Consider the following grammar: What is FOLLOW(Q)?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2017 Set 1 · Q17
Time

Select one answerSingle correct
Solution
Official answer: C) {w, y}
Lexical Analysis, Parsing and SDTTo find , look at all production rules where appears on the right-hand side:
In , the symbol following is , so includes .
Compute :
Since , we add to :
Combining these gives:
Thus, , which corresponds to option (C).
Try the question first, then check your work.
Examiner trap
Recall that for a production , contains , and if , it also includes .
This Lexical Analysis, Parsing and SDT previous year question is Q17 of the GATE CSE 2017 Set 1 paper. Find more GATE CSE PYQs on Lexical Analysis, Parsing and SDT in Compiler Design, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Lexical Analysis, Parsing and SDT PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Lexical Analysis, Parsing and SDT has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 9 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2017 Set 1.
How GATE tests Lexical Analysis, Parsing and SDTIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.