Professional Documents
Culture Documents
Compiler Design Kcs502 2022
Compiler Design Kcs502 2022
B. TECH.
(SEM V) THEORY EXAMINATION 2022-23
COMPILER DESIGN
SECTION A
2
90
13
(j) What is induction variable?
_2
2.
P1
24
SECTION B
5.
3D
.5
2. Attempt any three of the following: 10 x 3 = 30
P2
(a) Write SDD to produce three-address code for Boolean expressions and 17
Q
|1
obtain the three-address code for the statement given below:
7
while a < b do
:2
if c < d then
29
x=y*z
:
else
13
x=y+z
(b) Discuss the stack allocation and heap allocation strategies of the runtime
3
02
(d) Construct the NFA and DFA for the following regular expression.
8-
(0+1)*(00+11)(0+1)*
|1
(e) Explain the lexical analysis and syntax analysis phases of the compiler
with a suitable example. Explain the reporting errors in these two phases
as well.
SECTION C
Downloaded from|:18-01-2023
QP23DP1_290 uptukhabar.net
13:29:27 | 117.55.242.132
3. Attempt any one part of the following: 10 x 1 = 10
(a) Construct the CLR parse table for the following Grammar:
ABB
B cB
Bd
(b) Construct the SLR parsing table for the following Grammar.
S→ 0S0
S→ 1S1
S→ 10
2
90
(a) What is an activation record? Draw diagram of general activation
13
record and explain the purpose of different fields of an activation
_2
2.
record.
P1
24
and scope by location.
5.
3D
.5
P2
|1
symbol table.
(b) Explain the following:
7
(a) Explain in the DAG representation of the basic block with example.
-2
(b) Write quadruple, triples and indirect triples for following expression :
01
a = b * – c + b * – c.
8-
|1