CCPC
CCPC
SUBHARTI INSTITUTE OF TECHNOLOGY & ENGINEERING MEERUT Paper (2012-13) B TECH CSE !III YEAR PAPER "#$e% ECS: 603 ROLL NO%
COMPILER DESIGN
Time: 3 HRS NOTE- A&& '(e)*+#,) are "#-p(&)#r.. / 1 A**e-p* a,. 0#(r #0 *1e 0#&+,3% 456720 [Max. Marks-: 100]
a) Draw and explain several phases of a compiler. b) What do you mean by compiler? Describe Linker, Loader and Assembler. c) Draw the derivation for the following grammer ! aA!"a"!! A !bA"ba d) What do you mean by peephole optimi#ation? e) Write short notes on i. $nterpreter ii. %ross compiler Q.2 Attempt any four of the following: 5 !"2#
a) What do you mean by parsing? Describe &op'down and (ottom'up parsing techni)ues. b) %onstruct the operator precedence table for string id*id+id. c) %onsider the following grammer , -, , .i/ 0rame the transition table and Action12oto table of the given grammer. .ii/ Demonstrate that the grammer is !L3 or not. d) ,xplain the working of L3 parser model.
e) %onsider the context free grammar 2 ! AaAb ! (b A ( 0ind its first and follow sets. $s 2 LL.-/? 4ustify Q.$ Attempt any two of the following: %# 2"2#
a)
b) %onstruct three address code for a 6 'b+.c*7/. c) 2iven the !yntax'Directed Definition below with the !ynthesi#ed attribute val, draw the annotated parse tree for the expression .7*8/+.9*:/.
Q.! Attempt any two of the following& %# 2"2#
a) What are the various storage management techni)ue available and explain each? What are their importance in compiler design? b) What is hashing? ,xplain different types of hashing techni)ues. c) Write !hort notes on .i/ call by value .ii/ call by reference .iii/ %opy restore .iv/ call by %onstant Q.5 Attempt any two of the following& %# 2"2#
a) What is global data flow analysis? What is its use in code optimi#ation. b) ,xplain the need of code optimi#ation with example. c) ,xplain flow graph with example.