Questions

  1. GATE CS 2026 Set 1MSQ1 markEasy (estimate)

    GATE CS 2026 Set 1, Q.28

    Which of the following statements is/are true?

    Parsing and Syntax Analysis (LL and LR)

  2. GATE CS 2026 Set 2MSQ1 markEasy (estimate)

    GATE CS 2026 Set 2, Q.29

    Which of the following grammars is/are ambiguous?

    Parsing and Syntax Analysis (LL and LR)

  3. GATE CS 2026 Set 2MCQ2 marksHard (estimate)

    GATE CS 2026 Set 2, Q.41

    Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol. ...

    Parsing and Syntax Analysis (LL and LR)

  4. GATE CS 2025 Set 1MSQ2 marksEasy (estimate)

    GATE CS 2025 Set 1, Q.46

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

    Parsing and Syntax Analysis (LL and LR)

  5. GATE CS 2025 Set 2MCQ2 marksMedium (estimate)

    GATE CS 2025 Set 2, Q.40

    Given a Context-Free Grammar as follows: Which ONE of the following statements is TRUE?

    Parsing and Syntax Analysis (LL and LR)

  6. GATE CS 2025 Set 2MSQ2 marksHard (estimate)

    GATE CS 2025 Set 2, Q.51

    Consider two grammars and with the production rules given below…

    Parsing and Syntax Analysis (LL and LR)

  7. GATE CS 2024 Set 1MSQ1 markEasy (estimate)

    GATE CS 2024 Set 1, Q.26

    Which of the following is/are Bottom-Up Parser(s)?

    Parsing and Syntax Analysis (LL and LR)

  8. GATE CS 2024 Set 1NAT1 markEasy (estimate)

    GATE CS 2024 Set 1, Q.33

    Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below. Operator Precedence Associativity + Highest Left - High R...

    Parsing and Syntax Analysis (LL and LR)

  9. GATE CS 2024 Set 1MCQ2 marksMedium (estimate)

    GATE CS 2024 Set 1, Q.38

    Consider the following grammar , with as the start symbol. The grammar has three incomplete productions denoted by (1), (2), and (3).…

    Parsing and Syntax Analysis (LL and LR)

  10. GATE CS 2024 Set 2MCQ1 markEasy (estimate)

    GATE CS 2024 Set 2, Q.21

    Consider the following two sets: Set X Set Y P. Lexical Analyzer 1. Abstract Syntax Tree Q. Syntax Analyzer 2. Token R. Intermediate Code Generator 3. Parse Tree S. Code Optimiz...

    Lexical Analysis · Parsing and Syntax Analysis (LL and LR) · Intermediate Code Generation, Data Flow Analysis and Code Optimization

  11. GATE CS 2024 Set 2MCQ2 marksMedium (estimate)

    GATE CS 2024 Set 2, Q.40

    Consider the following context-free grammar where the start symbol is and the set of terminals is . …

    Parsing and Syntax Analysis (LL and LR)

  12. GATE CS 2024 Set 2NAT2 marksMedium (estimate)

    GATE CS 2024 Set 2, Q.65

    Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is …

    Parsing and Syntax Analysis (LL and LR)

  13. GATE CS 2022MCQ1 markEasy (estimate)

    GATE CS 2022, Q.13

    Which one of the following statements is TRUE?

    Parsing and Syntax Analysis (LL and LR)

  14. GATE CS 2022NAT1 markMedium (estimate)

    GATE CS 2022, Q.29

    Consider the augmented grammar with as the set of terminals. …

    Parsing and Syntax Analysis (LL and LR)

  15. GATE CS 2021 Set 1MCQ1 markMedium (estimate)

    GATE CS 2021 Set 1, Q.15 (CS Q.5)

    Consider the following statements. : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). : For any context-free grammar...

    Parsing and Syntax Analysis (LL and LR)

  16. GATE CS 2021 Set 1MCQ2 marksMedium (estimate)

    GATE CS 2021 Set 1, Q.41 (CS Q.31)

    Consider the following context-free grammar where the set of terminals is . …

    Parsing and Syntax Analysis (LL and LR)

  17. GATE CS 2021 Set 2MCQ1 markEasy (estimate)

    GATE CS 2021 Set 2, Q.13 (CS Q.3)

    Consider the following ANSI C program: int main() { Integer x; return 0; } Which one of the following phases in a seven-phase C compiler will throw an error?

    Parsing and Syntax Analysis (LL and LR) · Intermediate Code Generation, Data Flow Analysis and Code Optimization

  18. GATE CS 2021 Set 2NAT2 marksMedium (estimate)

    GATE CS 2021 Set 2, Q.61 (CS Q.51)

    Consider the following augmented grammar with as the set of terminals.…

    Parsing and Syntax Analysis (LL and LR)

  19. GATE CS 2020MCQ1 markEasy (estimate)

    GATE CS 2020, Q.19 (CS Q.9)

    Consider the following statements. I. Symbol table is accessed only during lexical analysis and syntax analysis. II. Compilers for programming languages that support recursion n...

    Runtime Environments and Parameter Passing · Parsing and Syntax Analysis (LL and LR) · Parsing and Syntax Analysis (LL and LR)

  20. GATE CS 2020MCQ1 markMedium (estimate)

    GATE CS 2020, Q.20 (CS Q.10)

    Consider the language and the following statements. I. is deterministic context-free. II. is context-free but no...

    Context-Free Grammars, Pushdown Automata and CFLs · Parsing and Syntax Analysis (LL and LR)

  21. GATE CS 2020NAT1 markEasy (estimate)

    GATE CS 2020, Q.34 (CS Q.24)

    Consider the following grammar. The number of reduction steps taken by a bottom-up parser while accepting the s...

    Parsing and Syntax Analysis (LL and LR)

  22. GATE CS 2019MCQ1 markEasy (estimate)

    GATE CS 2019, Q.13 (CS Q.3)

    Which one of the following kinds of derivation is used by LR parsers?

    Parsing and Syntax Analysis (LL and LR)

  23. GATE CS 2019NAT1 markMedium (estimate)

    GATE CS 2019, Q.29 (CS Q.19)

    Consider the grammar given below: Let and be indexed...

    Parsing and Syntax Analysis (LL and LR)

  24. GATE CS 2019NAT2 marksMedium (estimate)

    GATE CS 2019, Q.53 (CS Q.43)

    Consider the augmented grammar given below: Let…

    Parsing and Syntax Analysis (LL and LR)

  25. GATE CS 2018MCQ2 marksMedium (estimate)

    GATE CS 2018, Q.48 (CS Q.38)

    Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #. Parse tree for the expression a#bd#e#f showing precedence and...

    Parsing and Syntax Analysis (LL and LR)

  26. GATE CS 2017 Set 1MCQ1 markEasy (estimate)

    GATE CS 2017 Set 1, Q.17 (CS Q.17)

    Consider the following grammar: What is ?

    Parsing and Syntax Analysis (LL and LR)

  27. GATE CS 2017 Set 2MCQ1 markEasy (estimate)

    GATE CS 2017 Set 2, Q.5 (CS Q.5)

    Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it: | Input | Compiler Phase | | :--- | :--- | | (P) Syn...

    Lexical Analysis · Parsing and Syntax Analysis (LL and LR)

  28. GATE CS 2017 Set 2MCQ1 markEasy (estimate)

    GATE CS 2017 Set 2, Q.6 (CS Q.6)

    Which of the following statements about parser is/are CORRECT? I. Canonical LR is more powerful than SLR. II. SLR is more powerful than LALR. III. SLR is more powerful than Cano...

    Parsing and Syntax Analysis (LL and LR)

  29. GATE CS 2017 Set 2MCQ2 marksMedium (estimate)

    GATE CS 2017 Set 2, Q.32 (CS Q.32)

    Consider the following expression grammar : Which of the following g...

    Parsing and Syntax Analysis (LL and LR)

  30. GATE CS 2016 Set 2MCQ2 marksMedium (estimate)

    GATE CS 2016 Set 2, Q.55 (CS Q.45)

    Which one of the following grammars is free from left recursion?

    Parsing and Syntax Analysis (LL and LR)

  31. GATE CS 2016 Set 2MCQ2 marksMedium (estimate)

    GATE CS 2016 Set 2, Q.56 (CS Q.46)

    A student wrote two context-free grammars and for generating a single C-like array declaration. The dimension of the array is at least one. For example, int a[1...

    Parsing and Syntax Analysis (LL and LR) · Context-Free Grammars, Pushdown Automata and CFLs

  32. GATE CS 2015 Set 1MCQ1 markMedium (estimate)

    GATE CS 2015 Set 1, Q.23 (CS Q.13)

    Which one of the following is TRUE at any valid state in shift-reduce parsing?

    Parsing and Syntax Analysis (LL and LR)

  33. GATE CS 2015 Set 3MCQ1 markEasy (estimate)

    GATE CS 2015 Set 3, Q.26 (CS Q.16)

    Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most po...

    Parsing and Syntax Analysis (LL and LR)

  34. GATE CS 2015 Set 3MCQ2 marksEasy (estimate)

    GATE CS 2015 Set 3, Q.41 (CS Q.31)

    Consider the following grammar where and are non-terminal symbols…

    Parsing and Syntax Analysis (LL and LR)

  35. GATE CS 2014 Set 1MCQ2 marksMedium (estimate)

    GATE CS 2014 Set 1, Q.44 (CS Q.34)

    A canonical set of items is given below On input symbol the set has

    Parsing and Syntax Analysis (LL and LR)

  36. GATE CS 2014 Set 2MCQ1 markEasy (estimate)

    GATE CS 2014 Set 2, Q.27 (CS Q.17)

    Consider the grammar defined by the following production rules, with two operators and …

    Parsing and Syntax Analysis (LL and LR)

  37. GATE CS 2013MCQ1 markMedium (estimate)

    GATE CS 2013, Q.9 (CS Q.9)

    What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type and…

    Parsing and Syntax Analysis (LL and LR)

  38. GATE CS 2013MCQ2 marksMedium (estimate)

    GATE CS 2013, Q.40 (CS Q.40)

    Consider the following two sets of LR(1) items of an LR(1) grammar.…

    Parsing and Syntax Analysis (LL and LR)

  39. GATE CS 2012MCQ2 marksMedium (estimate)

    GATE CS 2012, Q.52 (CS Q.52)

    The FIRST and FOLLOW sets for the non-terminals A and B are

    Parsing and Syntax Analysis (LL and LR)

  40. GATE CS 2012MCQ2 marksMedium (estimate)

    GATE CS 2012, Q.53 (CS Q.53)

    The appropriate entries for E1, E2, and E3 are

    Parsing and Syntax Analysis (LL and LR)

  41. GATE CS 2011MCQ2 marksMedium (estimate)

    GATE CS 2011, Q.27 (CS Q.27)

    Consider two binary operators '' and '' with the precedence of operator being lower than that of operator . Operator is r...

    Parsing and Syntax Analysis (LL and LR)

Other topics of Compiler Design