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.

19Papers
12Years
41Questions
1Topics

Lexical and Syntax Analysis question pattern

Every graph below is calculated only from this selection.

Questions by year

Year-wise coverage for Lexical and Syntax Analysis. Each bar uses a separate theme-derived color.

Difficulty distribution

How the classified questions are distributed by difficulty.

Medium 30 73.2%
Easy 8 19.5%
Hard 3 7.3%

Question type distribution

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

MCQ 28 68.3%
Numerical Answer Type (NAT) 9 22%
MSQ 4 9.8%

Subject weightage

Top subjects by unique question coverage.

Computer Science & Information Technology
41 Qs

Most asked topics

Top topics across the included previous year papers.

Compiler Design
41 Qs

Subtopic coverage

Top subtopics inside this exact selection.

Lexical and Syntax Analysis
41 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) 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

Included previous year papers

Newest papers appear first. Sort by year, question coverage or name.

PaperYear / sessionQuestions in this viewOpen
Computer Science and Information Technology (CS) 202620262View paper
Computer Science and Information Technology (CS) 202620262View paper
Computer Science & Information Technology (CS) 2025 [Session 1]20252View paper
Computer Science & Information Technology (CS) 2025 [Session 2]20253View paper
Computer Science & Information Technology (CS) 2024 [Session 1]20244View paper
Computer Science & Information Technology (CS) 2024 [Session 2]20243View paper
Computer Science & Information Technology (CS) 2023 [Session 2]20231View paper
Computer Science & Information Technology (CS) 2022 [Session 2]20222View paper
Computer Science & Information Technology (CS) 2021 [Session 1]20212View paper
Computer Science & Information Technology (CS) 2021 [Session 2]20212View paper
Computer Science & Information Technology (CS) 2020 [Session 2]20202View paper
Computer Science & Information Technology (CS) 2019 [Session 2]20193View paper
Computer Science & Information Technology (CS) 2018 [Session 2]20182View paper
Computer Science & Information Technology (CS) 2017 [Session 2]20173View paper
Computer Science & Information Technology (CS) 2014 [Session 1]20141View paper
Computer Science & Information Technology (CS) 2014 [Session 2]20141View paper
Computer Science & Information Technology (CS) 2013 [Session 1]20132View paper
Computer Science & Information Technology (CS) 2013 [Session 3]20132View paper
Computer Science & Information Technology (CS) 2013 [Session 4]20132View paper

All Lexical and Syntax Analysis previous year questions

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

1
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
2
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
3
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
4
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
5
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
6
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
7
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
8
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
9
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
10
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
11
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
12
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
13
2019 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2019 [Session 2]

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

Open complete paper
14
2019 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2019 [Session 2]
Consider the grammar given below:
\( S \to Aa \)
\( A \to BD \)
\( B \to b \mid \epsilon \)
\( D \to d \mid \epsilon \)
Let \( a, b, d \), and \( \$ \) be indexed as follows:
abd$
3210

Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a, b, d, $}, then the answer should be 3210)
Answer: __________.
Open complete paper
15
2019 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2019 [Session 2]
Consider the augmented grammar given below:
S' → S
S → (L) | id
L → L, S | S
Let I0 = CLOSURE ({[S' → •S]}). The number of items in the set GOTO(I0, ( ) is: ______.
Open complete paper
16
2020 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2020 [Session 2]
Consider the following grammar.
\(S \rightarrow aSB \mid d\)
\(B \rightarrow b\)
The number of reduction steps taken by a bottom-up parser while accepting the string \(aaadbbh\) is ______.
Open complete paper
17
2020 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2020 [Session 2]
Consider the productions A → PQ and A → XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.
Rule 1: P.i = A.i + 2, Q.i = P.i + A.i, and A.s = P.s + Q.s
Rule 2: X.i = A.i + Y.s and Y.i = X.s + A.i
Which one of the following is TRUE?
Open complete paper
18
2021 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2021 [Session 1]
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 | ε R → c a T R | ε The following is a partially-filled LL(1) parsing table. | | a | b | c | d | f | $ | |---|---|---|---|---|---|---| | S | | | ① | S → d a T | ② | | | T | T → a S | T → b a T | ③ | | T → ε | ④ | | R | | | R → c a TR | | R → ε | | Which one of the following choices represents the correct combination for the numbered cells in the parsing table ("blank" denotes that the corresponding cell is empty)?
Open complete paper
19
2021 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2021 [Session 1]
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) \) time to parse a string of length \( n \).

Which one of the following options is correct?
Open complete paper
20
2021 · Computer Science & Information Technology · Compiler Design · Lexical and Syntax Analysis
Computer Science & Information Technology (CS) 2021 [Session 2]
Consider the following augmented grammar with {#, @, <, >, a, b, c} as the set of terminals.

S' → S
S → S # c S
S → S S
S → S @
S → < S >
S → a
S → b
S → c

Let I0 = CLOSURE({S' → •S}). The number of items in the set GOTO(GOTO(I0, <), <) is __________
Open complete paper

Showing 20 of 40 questions