Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Time: 03 Hours Maximum Marks: 100 Instructions To Candidates

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

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

PART- A 1 a Explain the different phases of compiler. 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, const, continue. 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, pattern, 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 Ba 4 a Construct SLR parsing table for the grammar S (L)|a L L,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. Write semantic 10 rule for desk calculator which performs the operations like addition(+), 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. 06 10 06 04 10 10

b Generate three address code for the following statements 08 i. a =b [i] [j] +c [d [k]]*10 ii. c = fun (a*b+c, g (I,j)) c Write the semantic rule for the following control construct 06 while (B)S1 for (S1;B;S2)S3 i. S 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, 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, generate intermediate code, construct 12 basic blocks and flow graph. for (i=0;i<n;i++)

You might also like