# Radha Govind Engineering College, Meerut

III Sessional Test – (2006-07) B.Tech V Semester (CS) Compiler Design (TCS 502)
Time: 1:00 hr. Note: Attempt any three questions. Q1. What is syntax directed translation scheme. Explain synthesized and inherited translation with a suitable example. Q2. (a) Explain global data flow analysis. (b) Explain DAG representation.
Q3. What do you understand by code optimization? Optimize the following three address code. (1) P:=0 (2) I:=1 (3) T1:=4*I (4) T2:=addr(A)-4 (5) T3:=T2[T1] (6) T4:=addr(B)-4 (7) T5:=T4[T1] (8) T6:=T3*T5 (9) P:=P+T6 (10) I:=I+1 (11) If I<=20 go to (3) Q4. Write three address code for following program fragment (a) while A<C and B<D do { if A=1 then C=C+1 else while A<=D do { A=A+2 } } (b) for(I=0;I<=20;I++) { if(I==2) { x=x+y+2; } else y=x*x+4; Q5. Translate the expression(i) (ii) a(a+b)*bb (0+1)*(00+11)(0+1)*

MM: 30

Radha Govind Engineering College, Meerut III Sessional Test – (2005-06) B.Tech VI Semester (CS) Compiler Construction (CS 604)
Time: 1:15 hr. Note: Attempt any three questions. Q1. (a) Explain global data flow analysis. (b) Explain DAG representation. Q2. What do you mean by code optimization. Explain with the help of an example. Q3. What is syntax directed translation scheme. How it is implemented in different ways? Q4. Write three address code for following program fragment C[I,j]=A[I,j]+B[I+1,C[I,j]] Q5. What do you understand by top down parsing? Explain all disadvantages of top down parsing. MM: 30

*********************** *******************