Semester : SEMESTER 6
Subject : Compiler Design
Year : 2021
Term : JULY
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 304
Page:3
15
16
17
18
19
20
a)
b)
a)
b)
a)
b)
a)
b)
03000CS304052002
PART E
Answer any four full questions, each carries 10 marks.
What is heap allocation strategy?
What is an activation record? Explain its structure with a figure.
Write quadruples, triples and indirect tuples for the expression
(a+b) *(b+c)+(a+b+c)
Write a syntax directed translation scheme that generates three address code for
Boolean expressions.
Distinguish between static and dynamic storage allocation.
Write the algorithm for identifying the basic blocks from a sequence of three
address code statements.
Construct the DAG for the following basic block
D:=B*C
E:=A+B
B:=B*C
A:=E-D
For the following C statement, write the three-address code.
> :=A-B+C-D+E-F
Convert the three-address code into machine code.
How do algebraic laws help in optimizing basic blocks?
Write the code generation algorithm.
ಸಸ್ಯ मर नर
Page 3 of 3
(3)
(7)
(10)
(7)
(3)
(5)
(5)
(10)
(4)
(6)