mca-501a-distributed-database-management-2012
mca-501a-distributed-database-management-2012
com
Name : …………………………………………….………………
Roll No. : …………………………………………...……………..
Invigilator’s Signature : ………………………………………..
CS/MCA/SEM-5/MCAE-504A/2012-13
2012
COMPILER DESIGN
Time Allotted : 3 Hours Full Marks : 70
GROUP – A
( Multiple Choice Type Questions )
GROUP – B
( Short Answer Type Questions )
Answer any three of the following. 3 × 5 = 15
5351 2
CS/MCA/SEM-5/MCAE-504A/2012-13
GROUP – C
( Long Answer Type Questions )
Answer any three of the following. 3 × 15 = 45
7. a) A grammar is given below :
S → aS |aSbS|∈
Show that the grammar is ambiguous by constructing
two parse trees and two leftmost derivations for aab.
b) Consider the following grammar :
S → CC
C → cC|d
Construct the canonical collection of LR(1) items for this
grammar. 8+7
8. a) Draw the DAG for the expression
a + a * (b – c) + ( b – c ) * d
b) What is syntax tree ?
c) Write the three address code for the following :
for (i = 1; i < 10; i++)
if (a < 10)
a = a + b;
else
a = a-b;
i) Constant Folding
v) Code motion.
b) Peephole optimization
c) Basic Block
d) Symbol table.
(a|b)*(ab)*aabb
and hence find out the FIRST and FOLLOW of the above
productions. 6+9
5351 4