My Cart
Your Cart 0

    Your cart is empty.

  • Total (Amount) ₹0.00
Previous year question hub

Lexical and Syntax Analysis - Compiler Design - Computer Science & Information Technology Previous Year Questions

Practice Lexical and Syntax Analysis - Compiler Design - Computer Science & Information Technology previous year questions organised from real papers, with year-wise coverage and clear topic navigation.

25Papers
17Years
53Questions
1Topics

Lexical and Syntax Analysis question pattern

Every graph below is calculated only from this selection.

Questions by year

Compare question counts across years.

Difficulty distribution

How the classified questions are distributed by difficulty.

Medium 38 71.7%
Easy 12 22.6%
Hard 3 5.7%

Question type distribution

MCQ, numerical, multiple-select and other formats found in these papers.

MCQ 39 73.6%
Numerical Answer Type (NAT) 9 17%
MSQ 4 7.5%
Fill in the blanks 1 1.9%

Subject weightage

Top subjects by unique question coverage.

Computer Science & Information Technology
53 Qs

Most asked topics

Top topics across the included previous year papers.

Compiler Design
53 Qs

Subtopic coverage

Top subtopics inside this exact selection.

Lexical and Syntax Analysis
53 Qs

Paper coverage

Question coverage for the most populated papers. Every active PYP paper remains listed below.

Computer Science and Information Technology (CS) 2026
2 Qs
Computer Science and Information Technology (CS) 2026
2 Qs
Computer Science & Information Technology (CS) 2025 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2025 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2024 [Session 1]
4 Qs
Computer Science & Information Technology (CS) 2024 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2023 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2022 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2021 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2021 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2020 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2019 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2018 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2017 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2017 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2014 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2014 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2013 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 3]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 4]
2 Qs
Computer Science & Information Technology (CS) 2011
3 Qs
Computer Science & Information Technology (CS) 2010
1 Qs
Computer Science & Information Technology (CS) 2009
2 Qs
Computer Science & Information Technology (CS) 2008
2 Qs
Computer Science & Information Technology (CS) 2007
3 Qs

Included previous year papers

Newest papers appear first. Search these papers or sort by year and name.

Paper nameYearPDFAttempt
Computer Science and Information Technology (CS) 20262026
2 questions in this view
2026
Computer Science and Information Technology (CS) 20262026
2 questions in this view
2026
Computer Science & Information Technology (CS) 2025 [Session 1]2025
2 questions in this view
2025
Computer Science & Information Technology (CS) 2025 [Session 2]2025
3 questions in this view
2025
Computer Science & Information Technology (CS) 2024 [Session 1]2024
4 questions in this view
2024
Computer Science & Information Technology (CS) 2024 [Session 2]2024
3 questions in this view
2024
Computer Science & Information Technology (CS) 2023 [Session 2]2023
1 questions in this view
2023
Computer Science & Information Technology (CS) 2022 [Session 2]2022
2 questions in this view
2022
Computer Science & Information Technology (CS) 2021 [Session 1]2021
2 questions in this view
2021
Computer Science & Information Technology (CS) 2021 [Session 2]2021
2 questions in this view
2021
Computer Science & Information Technology (CS) 2020 [Session 2]2020
2 questions in this view
2020
Computer Science & Information Technology (CS) 2019 [Session 2]2019
3 questions in this view
2019
Computer Science & Information Technology (CS) 2018 [Session 2]2018
2 questions in this view
2018
Computer Science & Information Technology (CS) 2017 [Session 1]2017
1 questions in this view
2017
Computer Science & Information Technology (CS) 2017 [Session 2]2017
3 questions in this view
2017
Computer Science & Information Technology (CS) 2014 [Session 1]2014
1 questions in this view
2014
Computer Science & Information Technology (CS) 2014 [Session 2]2014
1 questions in this view
2014
Computer Science & Information Technology (CS) 2013 [Session 1]2013
2 questions in this view
2013
Computer Science & Information Technology (CS) 2013 [Session 3]2013
2 questions in this view
2013
Computer Science & Information Technology (CS) 2013 [Session 4]2013
2 questions in this view
2013
Computer Science & Information Technology (CS) 20112011
3 questions in this view
2011
Computer Science & Information Technology (CS) 20102010
1 questions in this view
2010
Computer Science & Information Technology (CS) 20092009
2 questions in this view
2009
Computer Science & Information Technology (CS) 20082008
2 questions in this view
2008
Computer Science & Information Technology (CS) 20072007
3 questions in this view
2007

All Lexical and Syntax Analysis previous year questions

Practice every matching question in batches of 20, with every available option.

1
2007 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2007

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

Open complete paper
2
2007 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2007
Consider the grammar with non-terminals N = {S, C, S₁}, terminals T = {a, b, i, t, e}, with S as the start symbol, and the following set of rules:
S → iCtSS₁ | a
S₁ → eS | ε
C → b
The grammar is NOT LL(1) because:
Open complete paper
3
2007 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2007
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?
Open complete paper
4
2008 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2008

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

Open complete paper
5
2008 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2008

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

Open complete paper
6
2009 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2009

Match all items in Group 1 with correct options from those given in Group 2.

Group 1Group 2
P. Regular expression1. Syntax analysis
Q. Pushdown automata2. Code generation
R. Dataflow analysis3. Lexical analysis
S. Register allocation4. Code optimization
Open complete paper
7
2009 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2009
Which of the following statements are TRUE ?
I. There exist parsing algorithms for some programming languages whose complexities are less than O(n3).
II. A programming language which allows recursion can be implemented with static storage allocation.
III. No L-attributed definition can be evaluated in the framework of bottom-up parsing.
IV. Code improving transformations can be performed at both source language and intermediate code level.
Open complete paper
8
2010 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2010
The grammar \(S \to aSa \mid bS \mid c\) is
Open complete paper
9
2013 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2013 [Session 1]
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 \rightarrow \epsilon\) and \(A \rightarrow a\)) to parse a string with \(n\) tokens?
Open complete paper
10
2013 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2013 [Session 1]
Consider the following two sets of LR(1) items of an LR(1) grammar.
X -> c.X, c/d
X -> .cX, c/d
X -> .d, c/d
X -> c.X, $ X -> .cX, $ X -> .d, $ Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?
1. Cannot be merged since look aheads are different.
2. Can be merged but will result in S-R conflict.
3. Can be merged but will result in R-R conflict.
4. Cannot be merged since goto on c will lead to two different sets.
Open complete paper
11
2013 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2013 [Session 3]
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 → ε and A → a) to parse a string with n tokens?
Open complete paper
12
2013 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2013 [Session 3]
Consider the following two sets of LR(1) items of an LR(1) grammar.
X → c.X, c/d     X → c.X, $
X → .cX, c/d     X → .cX, $
X → .d, c/d     X → .d, $
Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?
1. Cannot be merged since look aheads are different.
2. Cannot be merged but will result in S-R conflict.
3. Can be merged but will result in R-R conflict.
4. Cannot be merged since goto on c will lead to two different sets.
Open complete paper
13
2013 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2013 [Session 4]
Consider the following two sets of LR(1) items of an LR(1) grammar.
X -> c.X, c/d
X -> .cX, c/d
X -> .d, c/d

X -> c.X, $
X -> .cX, $
X -> .d, $
Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?
1. Cannot be merged since look aheads are different.
2. Can be merged but will result in S-R conflict.
3. Can be merged but will result in R-R conflict.
4. Cannot be merged since goto on c will lead to two different sets.
Open complete paper
14
2014 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2014 [Session 1]
A canonical set of items is given below
\(S \to L . > R\)
\(Q \to R .\)
On input symbol < the set has
Open complete paper
15
2014 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2014 [Session 2]
Consider the grammar defined by the following production rules, with two operators * and +

\[ S \to T * P \]
\[ T \to U | T * U \]
\[ P \to Q + P | Q \]
\[ Q \to Id \]
\[ U \to Id \]

Which one of the following is TRUE?
Open complete paper
16
2017 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2017 [Session 2]
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:
Open complete paper
17
2017 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2017 [Session 2]
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 Canonical LR.
Open complete paper
18
2017 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2017 [Session 2]
Consider the following expression grammar \(G\): \(E \rightarrow E - T \mid T\), \(T \rightarrow T + F \mid F\), \(F \rightarrow (E) \mid id\). Which of the following grammars is not left recursive, but is equivalent to \(G\)?
Open complete paper
19
2018 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2018 [Session 2]

Which one of the following statements is FALSE?

Open complete paper
20
2018 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2018 [Session 2]
A lexical analyzer uses the following patterns to recognize three tokens \(T_1, T_2\), and \(T_3\) over the alphabet \(\{a,b,c\}\).
\[ \begin{aligned} T_1 &: a?(b|c)^*a \\ T_2 &: b?(a|c)^*b \\ T_3 &: c?(b|a)^*c \end{aligned} \]
Note that 'x?' means 0 or 1 occurrence of the symbol \(x\). Note also that the analyzer outputs the token that matches the longest possible prefix.
If the string \(bbaacabc\) is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
Open complete paper

Showing 20 of 52 questions