NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
VISIT NOW

GATE CSE

Parsing

Compiler Design

Previous Years Questions

Marks 1

More
Consider the augmented grammar with {+, *, (, ), id} as the set of terminals. S' $$\to$$ S S $$\to$$ S + R | R R $$\to$$...
GATE CSE 2022
Which one of the following statements is TRUE?
GATE CSE 2022
Consider the following grammar. S $$ \to $$ aSB| d B $$ \to $$ b The number of reduction steps taken by a bottom-up pars...
GATE CSE 2020
Which one of the following kinds of derivation is used by LR parsers?
GATE CSE 2019
Consider the grammar given below: S → Aa A → BD B → b | ε D → d | ε Let a, b, d, and $ be indexed as follows: Compute t...
GATE CSE 2019
Match the following: .tg {border-collapse:collapse;border-spacing:0;} .tg td{font-family:Arial, sans-serif;font-size:...
GATE CSE 2016 Set 2
Among simple $$LR (SLR) ,$$ canonical $$LR,$$ and look-ahead $$LR$$ $$(LALR),$$ which of the following pairs identify th...
GATE CSE 2015 Set 3
Match the following: .tg {border-collapse:collapse;border-spacing:0;border-color:#999;} .tg td{font-family:Arial, san...
GATE CSE 2015 Set 2
Which one of the following is TRUE at any valid state in shift-reduce parsing?
GATE CSE 2015 Set 1
Consider the grammar defined by the following production rules, with two operators * and + $$\eqalign{ & S \to T*P...
GATE CSE 2014 Set 2
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and uni...
GATE CSE 2013
Given the language L= { ab, aa, baa }, which of the following strings are in L* ? 1) abaabaaabaa 2) aaaabaaaa 3) baaa...
GATE CSE 2012
Which of the following describes a handle (as applicable to LR-parsing) appropriately?
GATE CSE 2008
Which one of the following is a top-down parser?
GATE CSE 2007
Consider the following grammar. $$\eqalign{ & S \to S*E \cr & S \to E \cr & E \to F + E \cr &a...
GATE CSE 2006
The grammar $$A \to AA\,|\,\left( A \right)\,|\,\varepsilon $$ is not suitable for predictive-parsing because the gramm...
GATE CSE 2005
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?
GATE CSE 2003
In a bottom-up evaluation of a syntax directed definition, inherited attributes can
GATE CSE 2003
Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship betwe...
GATE CSE 2003
Which of the following statements is false?
GATE CSE 2001
The process of assigning load addresses to the various parts of the program and adjusting the code and date in the progr...
GATE CSE 2001
Which of the following statements is true?
GATE CSE 1998
The pass numbers for each of the following activities (i) object code generation (ii) literals added to literal table ...
GATE CSE 1996

Marks 2

More
Consider the following statements. S1 : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars ...
GATE CSE 2021 Set 1
Consider the productions A $$ \to $$ PQ and A $$ \to $$ XY. Each of the five non-terminals A, P, Q, X, and Y has two att...
GATE CSE 2020
Consider the augmented grammar given below : S' → S S → 〈L〉 | id L → L,S | S Let I0 = CLOSURE ({[S' → ●S]}). Th...
GATE CSE 2019
Consider the following parse tree for the expression $$a \ne b\$ c\$ d \ne e \ne f,$$ involving two binary operators $$...
GATE CSE 2018
A student wrote two context-free grammars G1 and G2 for generating a single $$C$$-like array declaration. The dimension ...
GATE CSE 2016 Set 2
The attributes of three arithmetic operators in some programming language are given below. .tg {border-collapse:colla...
GATE CSE 2016 Set 1
Consider the following grammar $$G$$ $$\eqalign{ & \,\,\,\,\,\,\,S \to \,\,\,\,\,\,\,F|H \cr & \,\,\,\,\,...
GATE CSE 2015 Set 3
A canonical set of items is given below $$\eqalign{ & S \to L. > R \cr & Q \to R. \cr} $$ On input symb...
GATE CSE 2014 Set 1
Consider the following two sets of LR(1) items of an LR(1) grammar. $$\eqalign{ & X \to c.X,\,c/d\,\,\,\,\,\,\,\,X...
GATE CSE 2013
The grammar $$S \to aSa\,|\,\,bS\,|\,\,c$$ is
GATE CSE 2010
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
GATE CSE 2008
Consider the CFG with { S, A, B } as the non-terminal alphabet, { a, b } as the terminal alphabet, S as the start symbol...
GATE CSE 2007
Consider the CFG with { S, A, B } as the non-terminal alphabet, { a, b } as the terminal alphabet, S as the start symbol...
GATE CSE 2007
Consider the grammar with non-terminals N = { S, C, S1 }, terminals T = { a, b, i, t, e }, with S as the start symbol, a...
GATE CSE 2007
Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Whic...
GATE CSE 2007
Consider the following grammar: $$\eqalign{ & S \to FR \cr & R \to *S\,|\,\varepsilon \cr & F \to...
GATE CSE 2006
In the correct grammar of the previous question, what is the length of the derivation (number of steps starring from S) ...
GATE CSE 2006
Which one of the following grammars generates the following language? $$L = \left( {{a^i}{b^j}|i \ne j} \right)$$
GATE CSE 2006
Consider the following expression grammar. The seman­tic rules for expression calculation are stated next to each gramma...
GATE CSE 2005
Consider the following expression grammar. The seman­tic rules for expression calculation are stated next to each gramma...
GATE CSE 2005
Consider the grammar $$E \to E + n\,|\,E \times n\,|\,n$$ For a sentence n + n × n, the handles in the right-sentential ...
GATE CSE 2005
Consider the grammar $$S \to \left( S \right)\,|\,a$$ Let the number of states in SLR(1), LR(1) and LALR(1) parsers for ...
GATE CSE 2005
Consider the grammar with the following translation rules and E as the start symbol. $$\eqalign{ & E \to {E_1}\# T...
GATE CSE 2004
Which of the following grammar rules violate the requirements of an operator grammar? P, Q, R are nonterminals, and r, s...
GATE CSE 2004
Consider the grammar shown below. $$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$ This grammar is...
GATE CSE 2003
Consider the translation scheme shown below $$\eqalign{ & S \to TR \cr & R \to + T\left\{ {pr{\mathop{\rm...
GATE CSE 2003
Consider the grammar shown below $$\eqalign{ & S \to iEtSS'\,|\,\,a \cr & S' \to eS\,|\,\,\varepsilon \c...
GATE CSE 2003
A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding ...
GATE CSE 1995
Consider the SLR(1) and LALR (1) parsing tables for a context-free grammar. Which of the following statements is/are tru...
GATE CSE 1992

Marks 5

More
Consider the following grammar: $$\eqalign{ & S \to S \cr & S \to SS\,|\,a\,|\,\varepsilon \cr} $$ (a) Co...
GATE CSE 1988

Joint Entrance Examination

JEE Main JEE Advanced WB JEE

Graduate Aptitude Test in Engineering

GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN

Medical

NEET

CBSE

Class 12