GATE Compiler Design: Parsing and Syntax Analysis – Previous Year Questions
22 GATE previous year questions on Parsing and Syntax Analysis (Compiler Design, Computer Science) with answers and explanations, from every paper.
- GATE 2017 CS Q27 – Consider the following grammar: P xQRS Q yz z R w S y What is FOLLOW(Q)?
- GATE 2016 CS Q55 – The attributes of three arithmetic operators in some programming language are given below. Operator Precedence Associativity Arity --- --- --- --- +…
- GATE 2015 CS Q18 – Which one of the following is TRUE at any valid state in shift-reduce parsing?
- GATE 2018 CS Q48 – Consider the following parse tree for the expression `a#b\c\d#e#f`, involving two binary operators `\` and `#`. Which one of the following is correct…
- GATE 2019 CS Q13 – Which one of the following kinds of derivation is used by LR parsers?
- GATE 2019 CS Q29 – Consider the grammar given below: S → Aa A → BD B → b ε D → d ε Let a, b, d, and \ be indexed as follows: a b d \ --- --- --- --- 3 2 1 0 Compute the…
- GATE 2019 CS Q53 – Consider the augmented grammar given below: S' → S S → ⟨L⟩ id L → L,S S Let I 0=CLOSURE(\[S' S]\). The number of items in the set GOTO(I 0,) is:…
- GATE 2026 CS (CS2) Q41 – Consider canonical LR(0) parsing of the grammar below using terminals \a,b,c\ and non-terminals \A,B,C,S\, with S as the start symbol. S ACB A aA C cC…
- GATE 2026 CS (CS1) Q28 – Which of the following statements is/are true?
- GATE 2025 CS (CS2) Q40 – Given a Context-Free Grammar G as follows: S Aa bAc dc bda A d Which ONE of the following statements is TRUE?
- GATE 2025 CS (CS2) Q51 – Consider two grammars G 1 and G 2 with the production rules given below: G 1: S if\ E\ then\ S if\ E\ then\ S\ else\ S a E b G 2: S if\ E\ then\ S M M…
- GATE 2025 CS (CS1) Q46 – Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
- GATE 2024 CS (CS2) Q40 – Consider the CFG with start symbol S and terminals a,b,c,d: S AaAb BbBa, A cS, B dS. In the partially-filled LL(1) table, S row has S→AaAb at a,…
- GATE 2024 CS (CS2) Q65 – Consider the augmented grammar parsed with an SLR parser, terminals \a,b,c,d,\#,@\: S' S; S SS Aa bAc Bc bBa; A d\#; B @. Let I 0=CLOSURE(\S' S\). The…
- GATE 2024 CS (CS1) Q26 – Which of the following is/are Bottom-Up Parser(s)?
- GATE 2024 CS (CS1) Q33 – Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table: + (Highest, Left), - (High, Right),…
- GATE 2024 CS (CS1) Q38 – Consider grammar G with start symbol S: S→daT (1); T→aS bT (2); R→(3) ε. Terminals are a,b,c,d,f. FIRST(S)=c,d,f, FIRST(T)=a,b,ε, FIRST(R)=c,ε;…
- GATE 2022 CS Q13 – Which one of the following statements is TRUE?
- GATE 2022 CS Q29 – Consider the augmented grammar with \+, *, (, ), id\ as the set of terminals. S' S S S+R R R R*P P P (S) id If I 0 is the set of two LR(0) items \[S'…
- GATE 2021 CS Q15 – Consider the following statements. S 1: Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). S 2: For…
- GATE 2021 CS Q41 – Consider the following context-free grammar where the set of terminals is a, b, c, d, f. S -> d a T R f T -> a S b a T epsilon R -> c a T R epsilon…
- GATE 2020 CS Q34 – Consider the following grammar. S aSB d B b The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is .