chapter
    Top-Down and Predictive Parsing PYQs for GATE CS

    Solve 6+ Top-Down and Predictive Parsing previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2026 Slot Set1 PYQ

    Which of the following statements is/are true?

    Question 2
    2025 Slot Set2 PYQ
    Consider two grammars and with the production rules given below:






    where are the terminals.

    Which of the following option(s) is/are CORRECT?
    Question 3
    2025 Slot Set1 PYQ

    Which of the following statement(s) is/are <b>TRUE</b> while computing First and Follow during top down parsing by a compiler?

    Question 4
    2024 Slot Set2 PYQ
    Consider the following context-free grammar where the start symbol is and the set of terminals is . The following is a partially-filled LL(1) parsing table.

    abcd$SS → AaAbS → BbBa(1)(2)AA → ε(3)A → cSB(4)B → εB → dS

    Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

    Note: In the options, “blank” denotes that the corresponding cell is empty.
    Question 5
    2024 Slot Set1 PYQ
    Consider the following grammar , with as the start symbol. The grammar has three incomplete productions denoted by (1), (2), and (3).





    The set of terminals is . The FIRST and FOLLOW sets of the different non-terminals are as follows.

    , ,

    ,

    Which one of the following options CORRECTLY fills in the incomplete productions?
    Question 6
    2021 Slot Set1 PYQ
    Consider the following context-free grammar where the set of terminals is .


    The following is a partially-filled LL(1) parsing table.

    ① ②
    ③ ④

    Which one of the following choices represents the correct combination for the numbered cells in the parsing table (“blank” denotes that the corresponding cell is empty)?
    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Top-Down and Predictive Parsing PYQs for GATE CS

    Solve 6+ Top-Down and Predictive Parsing previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Top-Down and Predictive Parsing

    Chapter · Top-Down and Predictive Parsing
    Three topics, one engine
    From "what can start a string" to "which table cell to fill".
    01
    FIRST and FOLLOW Set Computation
    This topic · moderate weight · 2 PYQs in this course
    Build the two foundational sets that make predictive parsing possible. By the end you will compute FIRST and FOLLOW for any CFG by hand.
    02
    LL(1) Grammar Conditions and Predictive Parsing
    Moderate weight · 2 PYQs in this course
    Use FIRST and FOLLOW to decide whether a grammar is LL(1). Master the disjointness condition that removes ambiguity in top-down choices.
    03
    LL(1) Parsing Table Construction
    Moderate weight · 2 PYQs in this course
    Turn the disjointness condition into a concrete table. Fill entries, detect conflicts, and read off parse steps.
    By the end of this chapter you will
    • Compute FIRST and FOLLOW sets for any CFG in under two minutes.
    • Decide in one glance whether a grammar is LL(1) or not.
    • Build the full LL(1) parsing table and trace a derivation.

    What are FIRST and FOLLOW, and why do they exist?

    A top-down parser expands non-terminals one at a time. At each step it must pick a production. To pick correctly while reading the input only once, it needs two pieces of information about every non-terminal :

    FIRST of

    The set of terminals that can appear at the very beginning of a string derived from .

    FOLLOW of

    The set of terminals that can appear immediately to the right of in some sentential form.

    Together they answer the parser's only real question:

    "Given that I am about to expand , and the next input token is , which production of should I use?"

    If the grammar is well-behaved (LL(1)), the answer is unique. Computing FIRST and FOLLOW is the first step toward checking that, and toward building the parsing table.

    Top-Down and Predictive Parsing: Solved Questions with Step-by-Step Explanations (6 Problems)

    Question 1 · Compiler Design · 2026_Set1 MSQ

    Which of the following statements is/are true?

    1. A.

      LL(1) parser uses backtracking

    2. B.

      For a grammar to be LL(1), it must be left-recursive

    3. C.

      For a grammar to be LL(1), it must be left-factored

    4. D.

      The LL(1) parsers are more powerful than the SLR parsers

    Question 2 · Compiler Design · 2025_Set2 MSQ
    Consider two grammars and with the production rules given below:






    where are the terminals.

    Which of the following option(s) is/are CORRECT?
    1. A.

      is not and is .

    2. B.

      is and is not .

    3. C.

      and are not .

    4. D.

      and are ambiguous.

    Question 3 · Compiler Design · 2025_Set1 MSQ

    Which of the following statement(s) is/are <b>TRUE</b> while computing First and Follow during top down parsing by a compiler?

    1. A.

      For a production , will be added to .

    2. B.

      If there is any input right end marker, it will be added to , where is the start symbol.

    3. C.

      For a production , will be added to .

    4. D.

      If there is any input right end marker, it will be added to , where is the start symbol.

    Question 4 · Compiler Design · 2024_Set2 MCQ
    Consider the following context-free grammar where the start symbol is and the set of terminals is . The following is a partially-filled LL(1) parsing table.

    abcd$SS → AaAbS → BbBa(1)(2)AA → ε(3)A → cSB(4)B → εB → dS

    Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

    Note: In the options, “blank” denotes that the corresponding cell is empty.
    1. A.

    2. B.

    3. C.

    4. D.

    Question 5 · Compiler Design · 2024_Set1 MCQ
    Consider the following grammar , with as the start symbol. The grammar has three incomplete productions denoted by (1), (2), and (3).





    The set of terminals is . The FIRST and FOLLOW sets of the different non-terminals are as follows.

    , ,

    ,

    Which one of the following options CORRECTLY fills in the incomplete productions?
    1. A.

    2. B.

    3. C.

    4. D.

    Question 6 · Compiler Design · 2021_Set1 MCQ
    Consider the following context-free grammar where the set of terminals is .


    The following is a partially-filled LL(1) parsing table.

    ① ②
    ③ ④

    Which one of the following choices represents the correct combination for the numbered cells in the parsing table (“blank” denotes that the corresponding cell is empty)?
    1. A.

      ①  ②  ③  ④

    2. B.

      ① blank ②  ③  ④

    3. C.

      ①  ② blank ③ blank ④

    4. D.

      ① blank ②  ③ blank ④ blank

    More previous year questions (pyqs) in this unit