Radha Govind Engineering College, Meerut III Sessional Test – (2006-07) B.Tech V Semester (CS) Compiler Design (TCS 502) Time: 1:00 hr.
MM: 30
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
a(a+b)*bb (0+1)*(00+11)(0+1)*
Radha Govind Engineering College, Meerut III Sessional Test – (2005-06) B.Tech VI Semester (CS) Compiler Construction (CS 604) Time: 1:15 hr.
MM: 30
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.
*********************** *******************
Radha Govind Engineering College, Meerut III Sessional Test – (2004-05) B.Tech VI Semester (CS) Compiler Construction (CS 604) Time: 1:15 hr. MM: 30 Note: Attempt any three questions. Q.1) Translate the following assignment statement into three-address code using the translation scheme. A[i , j] :=B[i ,j] + C[A[k ,l]] + D[i+j] Q.2) When a procedure is passed as a parameter in a lexically scoped language, its nonsocial environment can be passed using an access link. Give an algorithm to determine this link. Q.3) What do you understand by code optimization? Optimize the following three-address code. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11)
P: =0 I: =1 T1: =4*I T2: =addr(A)-4 T3: =T2 [T1] T4: =addr(B)-4 T5: =T4[T1] T6: =T3*T5 P: =P+T6 I: =I+1 If I<=20 go to (3)
Q.4) What are the applications of Global data flow analysis and DAG. _______________________________