07CS53

USN R. V. COLLEGE OF ENGINEERING
Autonomous Institution under VTU V Semester B. E. Examinations Dec-09/Jan-10 Computer Science and Engineering COMPILER DESIGN Time: 03 Hours Maximum Marks: 100 Instructions to candidates: Answer any five full questions choosing at least 2 questions from part A and two questions from part B

b Describe in brief any two applications of compiler Technology c Explain the different software productivity tools used in compiler design 08 04 08 2 a Write a transition diagram to recognize the words char. subtraction(-) and multiplication(*) b Explain the order of evaluation of attributes in annotated parse tree 05 c Write a note on compaction of LR parsing table 05 6 a Describe the different ways of implementing intermediate code. construct 12 basic blocks and flow graph. 06 10 06 04 10 10 b Generate three address code for the following statements 08 i. 08 Write the pseudocode for the start state b Write a note on Input buffering in lexical phase of compiler 06 c Define the terms lexeme. Write semantic 10 rule for desk calculator which performs the operations like addition(+). continue.A 1 a Explain the different phases of compiler. c = fun (a*b+c.i<n.PART.S2)S3 i. const. g (I. for (i=0. S ii. generate intermediate code.i++) . token with an example 06 3 a Construct LL(1) parsing table for the grammar S → S+S | SS | (S) |S* |a b Explain the principle of non recursive predictive parsing c Left factor the grammar A → bBc|bBd|bcd|b|a B→a 4 a Construct SLR parsing table for the grammar S → (L)|a L → L. generate machine code and compute the cost of set of instruction s=0 i=0 L1: if i>n go to L2 s=s+i i=i+1 go to L1 L2: 08 b For the following set of statements.S|S b Construct LR(1) items for the grammar S → Aa|bAc|Bc|bBa A → d B → d PART-B 5 a Define synthesized and inherited attributes with example. pattern.j)) c Write the semantic rule for the following control construct 06 → while (B)S1 → for (S1. a =b [i] [j] +c [d [k]]*10 ii. S 7 a Explain the different fields of activation record b Write the design rules for garbage collector c Describe the functions of heap manager 06 08 06 8 a For the following intermediate code.B.

Sign up to vote on this title
UsefulNot useful