Karaikudi Institute of Technology & Karaikudi Institute of Management

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

KARAIKUDI INSTITUTE OF TECHNOLOGY

&
KARAIKUDI INSTITUTE OF MANAGEMENT

UNIT TEST III FEBRUARY 2014
Roll No: Year/Dept: III/ CSE Date: 26 Wedneda! 2014

CS2352- PRINCIPLES OF COMPILER DESIGN
T"#e: 0$:1% A&'& ( 11:00 A&'&
50
Mark
s
(Answer All the !est"#ns$
PAR% A - 2 Mark s (5&2'(0$
1. List out the benefits of machine independent intermediate forms.
2. Write the properties of intermediate language?
3. List various forms of intermediate code.
4. What are the different ways of implementing the three address code?
5. What is bacpatching?
2
PAR% )
1. !efine three address code.!escribe the various mathods of implementing the three address
statement with an e"ample.
2. #i$%ive the translation scheme for converting the assignments into three address code for the
following grammar
&'(id)*+ +'(+1,+2 +'(+1-+2
+'('+1 +'(#+1$ +'(id
#ii$%ive the synta" directed translation for the case statement
&witch +
.
/ase 01)&1
111
/ase 0n'1)&n'1
!efault)&n
2
#or$
3. !iscuss the various methods for translating the 3oolean e"pression
4. #i$%ive the synta" directed translation scheme for the statement #call p1#int a4int b$$
#ii$+"plain the process of generating the code for a 3oolean e"pression in a single pass using
bacpatching.
#or$
5. 5ranslate #a or b$and#c6d$and#d6e$ into three address statement using bacpatching.
)
10
6
16
)
)
16
*repared +!,
-&NA
ND.INI, /T/CSE
KARAIKUDI INSTITUTE OF TECHNOLOGY
&
KARAIKUDI INSTITUTE OF MANAGEMENT

UNIT TEST III FEBRUARY 2014
Roll No: Year/Dept: III/ CSE Date: 26 Wedneda! 2014

*********************ALL THE BEST*********************



6
*repared +!,
-&NA
ND.INI, /T/CSE
KARAIKUDI INSTITUTE OF TECHNOLOGY
&
KARAIKUDI INSTITUTE OF MANAGEMENT

UNIT TEST III FEBRUARY 2014
Roll No: Year/Dept: III/ CSE Date: 26 Wedneda! 2014

0""1 Con"der t2e 3ollo4"n5 nap2ot o3 a !te# :
Allo6at"on 'a7 A8a"la+le
ABCD ABCD ABCD
*9 0 0 1 2 0 0 1 2 1 % 2 0
*I 1 0 0 0 1 : % 0
*2 1 ; % 4 2 ; % 6
*; 0 6 ; 2 0 6 % 2
*4 0 0 1 4 0 6 % 6
An4er t2e 3ollo4"n5 <=et"on ="n5 +an>er? al5or"t2# :
#1$ W2at " t2e 6ontent o3 t2e #atr"7 Need@
#2$ I t2e !te# "n a a3e tate@
#3$ I3 a re<=et 3ro# pro6e *I arr"8e 3or 00,4,2,01 6an t2e
re<=et +e 5ranted "##ed"atel!@
09R1
;
2
%
*repared +!,
-&NA
ND.INI, /T/CSE
KARAIKUDI INSTITUTE OF TECHNOLOGY
&
KARAIKUDI INSTITUTE OF MANAGEMENT

UNIT TEST III FEBRUARY 2014
Roll No: Year/Dept: III/ CSE Date: 26 Wedneda! 2014

1;& +& E7pla"n "n deta"l e5#entat"on 4"t2 pa5"n5&
14& a 0"1 D"t"n5="2 De#and pa5"n5 and ant"6"pator! pa5"n5&
0""1 Co##ent on "n8erted pa5e ta+le and t2e"r =e "n pa5"n5 and
e5#entat"on&
09R1
+& E7pla"n t2e ad8anta5e and 2ort6o#"n5 o3 /RU appro7"#at"on pa5e
repla6e#ent
1%& a Con"der a t!p"6al "t=at"on "n a #=lt"pro5ra##"n5 en8"ron#ent, "n
42"62 t2e operat"n5 !te# #a"nta"n a <=e=e o3 re<=et 3or ea62 I/9
de8"6e& A=#e t2e d"> 2a 200 tra6> and t2at t2e d"> re<=et <=e=e
2a rando# re<=et "n "t& T2e re<=eted tra6> are re6e"8ed "n t2e
3ollo4"n5 order: %%, %), ;$, 1), $0, 160, 1%0, ;), 1)4, 2:, 12$, 110, 1)6,14:,
41, 10, 64, 120& A=#e t2at t2e 2ead d"> " "n"t"all! po"t"oned o8er tra6>
100 and " #o8"n5 "n t2e d"re6t"on o3 de6rea"n5 tra6> n=#+er& *er3or# t2e
anal!" 3or FIF9, SSTF, SCAN, CASCAN, /99- and CA/99-& Co#pare t2e
re=lt and 5"8e re6o##endat"on&
09R1
1%& +& B" 8en #e#or! part" t" on o3 100-, %00-, 200-, ;00-, and 600- "n
order1, 2o4 4o=ld ea62 o3 t2e F"rtACt, BetACt, and WortACt al5or"t2#
pla6e pro6ee o3 412-, ;1:-, 112-, and ;26- 0"n order1@ W2"62 al5or"t2#
#a>e t2e #ot eD6"ent =e o3 #e#or!@
16
)
)
16
16
16
Prepared by
*repared +!,
-&NA
ND.INI, /T/CSE

You might also like