Crack
GATE
C
G
Topic
Lexical Analysis and Parsing
Compiler Design
0
/ 29 done
Questions per paper
All
MCQ
MSQ
NAT
2015 to 2026. Point at a year to read it.
0
1
2
3
4
2015
2019
2021
2023
2025
2026
Show as a table
Year
All
MCQ
MSQ
NAT
2015
1.3
1.3
0
0
2018
0
0
0
0
2019
4
2
0
2
2020
0
0
0
0
2021
2
1.5
0
0.5
2022
2
1
0
1
2023
1
1
0
0
2024
3
1.5
0.5
1
2025
2
1
1
0
2026
2
0.5
1
0.5
1
CS 2026 Set 1 · 1 mark · MSQ · Moderate
Consider the following C statements:
2
CS 2026 Set 1 · 1 mark · MSQ · Moderate
Which of the following statements is/are true?
3
CS 2026 Set 2 · 1 mark · NAT · Moderate
A lexical analyzer uses the following token definitions
4
CS 2026 Set 2 · 2 marks · MCQ · Moderate
Consider the canonical
L
R
(
0
)
LR(0)
L
R
(
0
)
parsing of the grammar below using terminals {a, b, c} and non-terminals {A, B, C} with
S
S
S
as the start symbol.
5
CS 2025 Set 1 · 1 mark · MCQ · Easy
Which ONE of the following statements is
FALSE
regarding the symbol table?
6
CS 2025 Set 1 · 2 marks · MSQ · Easy
Which of the following statement(s) is/are TRUE while computing
F
i
r
s
t
\mathit{First}
First
and
F
o
l
l
o
w
\mathit{Follow}
Follow
during top down parsing by a compiler?
7
CS 2025 Set 2 · 2 marks · MCQ · Hard
Given a Context-Free Grammar
G
G
G
as follows:
8
CS 2025 Set 2 · 2 marks · MSQ · Moderate
Consider two grammars
G
1
G_1
G
1
and
G
2
G_2
G
2
with the production rules given below:
9
CS 2024 Set 1 · 1 mark · MSQ · Easy
Which of the following is/are Bottom-Up Parser(s)?
10
CS 2024 Set 1 · 1 mark · NAT · Hard
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.
11
CS 2024 Set 1 · 2 marks · MCQ · Hard
Consider the following grammar
G
G
G
, with
S
S
S
as the start symbol. The grammar
G
G
G
has three incomplete productions denoted by (1), (2), and (3).
12
CS 2024 Set 2 · 1 mark · MCQ · Easy
Consider the following two sets:
13
CS 2024 Set 2 · 2 marks · MCQ · Moderate
Consider the following context-free grammar where the start symbol is
S
S
S
and the set of terminals is
{
a
,
b
,
c
,
d
}
\{a,b,c,d\}
{
a
,
b
,
c
,
d
}
.
14
CS 2024 Set 2 · 2 marks · NAT · Moderate
Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is
{
a
,
b
,
c
,
d
,
#
,
@
}
\{a,b,c,d,\#, @\}
{
a
,
b
,
c
,
d
,
#
,
@
}
15
CS 2023 · 1 mark · MCQ · Moderate
Consider the following definition of a lexical token
i
d
\mathrm{id}
id
for an identifier in a programming language, using extended regular expressions:
16
CS 2022 · 1 mark · MCQ · Moderate
Which one of the following statements is TRUE?
17
CS 2022 · 1 mark · NAT · Moderate
Consider the augmented grammar with
{
+
,
∗
,
(
,
)
,
i
d
}
\{+, *, (, ), id\}
{
+
,
∗
,
(
,
)
,
i
d
}
as the set of terminals.
18
CS 2021 Set 1 · 1 mark · MCQ · Moderate
Consider the following statements.
19
CS 2021 Set 1 · 2 marks · MCQ · Moderate
Consider the following context-free grammar where the set of terminals is
{
a
,
b
,
c
,
d
,
f
}
\{a, b, c, d, f\}
{
a
,
b
,
c
,
d
,
f
}
.
20
CS 2021 Set 2 · 1 mark · MCQ · Easy
Consider the following ANSI C program:
21
CS 2021 Set 2 · 2 marks · NAT · Moderate
Consider the following augmented grammar with
{
#
,
@
,
<
,
>
,
a
,
b
,
c
}
\{\#, @, <, >, a, b, c\}
{
#
,
@
,
<
,
>
,
a
,
b
,
c
}
as the set of terminals.
22
CS 2019 · 1 mark · MCQ · Easy
Which one of the following kinds of derivation is used by LR parsers?
23
CS 2019 · 1 mark · NAT · Moderate
Consider the grammar given below:
24
CS 2019 · 2 marks · MCQ · Moderate
Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let
X
1
X_1
X
1
,
X
2
X_2
X
2
,
X
3
X_3
X
3
,
X
4
X_4
X
4
,
X
5
X_5
X
5
, and
X
6
X_6
X
6
be the placeholders for the non-terminals D, T, L or
L
1
\text{L}_1
L
1
in the following table:
25
CS 2019 · 2 marks · NAT · Moderate
Consider the augmented grammar given below:
26
CS 2015 Set 1 · 1 mark · MCQ · Easy
Which one of the following is TRUE at any valid state in shift-reduce parsing?
27
CS 2015 Set 2 · 1 mark · MCQ · Moderate
Match the following:
28
CS 2015 Set 3 · 1 mark · MCQ · Moderate
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?
29
CS 2015 Set 3 · 2 marks · MCQ · Moderate
Consider the following grammar
G
G
G