Skip to content
Early access — you're among the first to try PYQLabs. Share feedback

Parsing

GATE CSE & IT · 51 questions across 23 years (1988-2026) · 57% recurrence rate

Recurrence sparkline

19882026
198820072026

Difficulty mix

easy 41%
med 59%

Question types

MCQ39
NAT6
MSQ4
STMT1
OTHER1

All 51 questions on Parsing

2026 PYQ

Consider the canonical $L R(0)$ parsing of the grammar below using terminals $\{a, b, c\}$ and non-terminals $\{A, B, C, S\}$ with $S$ as the start symbol. $$ \begin{aligned} & S \rightarrow A C B \\ & A \rightarrow \alp...

Med
2026 PYQ

Which of the following statements is/are true?

Easy
2025 PYQ

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

Easy
2025 PYQ

Given a Context-Free Grammar G as follows : $S \rightarrow A a|b a c| d c \mid b d a$ $A \rightarrow d$ Which ONE of the following statements is TRUE?

Med
2025 PYQ

Consider two grammars $G_1$ and $G_2$ with the production rules given below: $G_1: S \rightarrow$ if $E$ then $S \mid$ if $E$ then $S$ else $S \mid a$ $$\mathrm{E} \rightarrow \mathrm{~b}$$ $G_2: S \rightarrow$ if $E$ th...

Med
2024 PYQ

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

Easy
2024 PYQ

Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is $\{ a, b, c, d, \, \#, \, @ \}$ $S' \rightarrow S$ $S \rightarrow SS \;|\; Aa \;|\; bAc \;|\; Bc \;|\; bBa$ $A \r...

Med
2024 PYQ

Consider the following context-free grammar where the start symbol is S and the set of terminals is {a,b,c,d}. $ S \rightarrow AaAb \mid BbBa $ $ A \rightarrow cS \mid \epsilon $ $ B \rightarrow dS \mid \epsilon $ The fo...

Med
2024 PYQ

Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by (1), (2), and (3). $$S \rightarrow d a T \mid \underline{\ (1)}$$ $$T \rightarrow a S \mid b T...

Med
2022 PYQ

Consider the augmented grammar with {+, *, (, ), id} as the set of terminals. S' $$\to$$ S S $$\to$$ S + R | R R $$\to$$ R * P | P P $$\to$$ (S) | id If I 0 is the set of two LR(0) items {[S' $$\to$$ S.], [S $$\to$$ S. +...

Med
2022 PYQ

Which one of the following statements is TRUE?

Med
2021 PYQ

Consider the following augmented grammar with {#, @, <, >, a, b, c} as the set of terminals. S' → S S → S # cS S → SS S → S @ S → < S > S → a S → b S → c Let I 0 = CLOSURE({S' → ∙ S}). The number of items in the set GOTO...

Med
2021 PYQ

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 any context-free grammar, there is a parser that takes at most O(n 3...

Med
2020 PYQ

Consider the following grammar. S $$ \to $$ aSB| d B $$ \to $$ b The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is _______.

Easy
2019 PYQ

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

Easy
2019 PYQ

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: _____.

Med
2016 PYQ

The attributes of three arithmetic operators in some programming language are given below. Operator Precedence Associativity Arity + High Left Binary _ Medium Right Binary * Low Left Binary The value of the expression $$...

Med
2016 PYQ

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

Med
2016 PYQ

A student wrote two context-free grammars G1 and G2 for generating a single $$C$$-like array declaration. The dimension of the array is at least one. For example, $$${\mathop{\rm int}} \,\,\,\,\,\,\,a[10]\,\,[3];$$$ The...

Med
2015 PYQ

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

Med
2015 PYQ

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 powerful , in that order?

Easy
2015 PYQ

Consider the following grammar $$G$$ $$\eqalign{ & \,\,\,\,\,\,\,S \to \,\,\,\,\,\,\,F|H \cr & \,\,\,\,\,\,F \to \,\,\,\,\,\,\,p|c \cr & \,\,\,\,\,\,H \to \,\,\,\,\,\,\,d|c \cr} $$ where $$S, F$$ and $$H$$ are non-termin...

Easy
2014 PYQ

Consider the grammar defined by the following production rules, with two operators * and + $$\eqalign{ & S \to T*P \cr & T \to U\,|\,T*U \cr & P \to Q + P\,|\,Q \cr & Q \to id \cr & U \to id \cr} $$ Which one of the foll...

Easy
2014 PYQ

A canonical set of items is given below $$\eqalign{ & S \to L. > R \cr & Q \to R. \cr} $$ On input symbol < the set has

Easy
2013 PYQ

Consider the following two sets of LR(1) items of an LR(1) grammar. $$\eqalign{ & X \to c.X,\,c/d\,\,\,\,\,\,\,\,X \to c.X,\$ \cr & X \to .cX,c/d\,\,\,\,\,\,\,\,X \to .cX,\$ \cr & X \to .d,c/d\,\,\,\,\,\,\,\,\,\,\,X \to...

Med
2013 PYQ

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 $$A \to \varepsilon $$ and $$A \to a$$ ) to parse a string with n token...

Med
2010 PYQ

The grammar $$S \to aSa\,|\,\,bS\,|\,\,c$$ is

Easy
2008 PYQ

An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if

Med
2008 PYQ

Which of the following describes a handle (as applicable to LR-parsing) appropriately?

Easy
2007 PYQ

Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Which of the following is TRUE?

Med
2007 PYQ

Which one of the following is a top-down parser?

Easy
2007 PYQ

Consider the grammar with non-terminals N = { S, C, S 1 }, terminals T = { a, b, i, t, e }, with S as the start symbol, and the following set of rules: $$\eqalign{ & S \to iCtS{S_1}\,|\,\,a \cr & {S_1} \to eS\,|\,\,\vare...

Med
2006 PYQ

Consider the following grammar: $$\eqalign{ & S \to FR \cr & R \to *S\,|\,\varepsilon \cr & F \to id \cr} $$ In the predictive parser table, M, of the grammar the entries $$M\left[ {S,id} \right]$$ and $$M\left[ {R,\$ }...

Med
2006 PYQ

Consider the following grammar. $$\eqalign{ & S \to S*E \cr & S \to E \cr & E \to F + E \cr & E \to F \cr & F \to id \cr} $$ Consider the following LR(0) items corresponding to the grammar above. $$\eqalign{ & (i)\,S \to...

Med
2005 PYQ

Consider line number 3 of the following C - program. int main ( ) { /* Line 1 */ int I, N; /* Line 2 */ fro (I = 0, I < N, I++); /* Line 3 */ } Identify the compiler's response about this line while creating the object-m...

Med
2005 PYQ

Consider the grammar $$E \to E + n\,|\,E \times n\,|\,n$$ For a sentence n + n × n, the handles in the right-sentential form of the reduction are

Med
2005 PYQ

The grammar $$A \to AA\,|\,\left( A \right)\,|\,\varepsilon $$ is not suitable for predictive-parsing because the grammar is

Easy
2005 PYQ

Consider the following expression grammar. The seman­tic rules for expression calculation are stated next to each grammar production. $$\eqalign{ & E \to number\,\,\,\,\,E.val = number.val \cr & \,\,\,\,\,\,\,\,\,\,\,|E\...

Med
2005 PYQ

Consider the grammar $$S \to \left( S \right)\,|\,a$$ Let the number of states in SLR(1), LR(1) and LALR(1) parsers for the grammar be n 1 , n 2 and n 3 respectively. The following relationship holds good

Med
2005 PYQ

Consider the following expression grammar. The seman­tic rules for expression calculation are stated next to each grammar production. $$\eqalign{ & E \to number\,\,\,\,\,E.val = number.val \cr & \,\,\,\,\,\,\,\,\,\,\,|E\...

Med
2005 PYQ

What does the following C statement declare? int (*f)(int *);

Easy
2004 PYQ

Which of the following grammar rules violate the requirements of an operator grammar? P, Q, R are nonterminals, and r, s, t are terminals. $$\eqalign{ & 1.\,P \to QR \cr & 2.\,P \to QsR \cr & 3.\,P \to \varepsilon \cr &...

Easy
2003 PYQ

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

Easy
2003 PYQ

Assume that the SLR parser for a grammar G has n 1 states and the LALR parser for G has n 2 states. The relationship between n 1 and n 2 is

Easy
2003 PYQ

Consider the grammar shown below. $$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$ This grammar is

Easy
2003 PYQ

Consider the grammar shown below $$\eqalign{ & S \to iEtSS'\,|\,\,a \cr & S' \to eS\,|\,\,\varepsilon \cr & E \to b \cr} $$ In the predictive parse table, $$M$$, of this grammar, the entries $$M\left[ {S',e} \right]$$ an...

Med
2001 PYQ

Which of the following statements is false?

Easy
1998 PYQ

Which of the following statements is true?

Easy
1997 PYQ

In the following grammar: $$\eqalign{ & X:: = X \oplus {Y \over Y} \cr & Y:: = Z*{Y \over Z} \cr & Z:: = id \cr} $$ Which of the following is true?

Easy
1992 PYQ

Consider the SLR(1) and LALR (1) parsing tables for a context-free grammar. Which of the following statements is/are true?

Med
1988 PYQ

Consider the following grammar: $$\eqalign{ & S \to S \cr & S \to SS\,|\,a\,|\,\varepsilon \cr} $$ (a) Construct the collection of sets of LR(0) items for this grammar and draw its go to graph. (b) Indicate the shift-red...

Med