0% found this document useful (0 votes)
63 views

3rd Sess Comp

The document contains 5 questions related to compiler design on the topics of syntax directed translation, global data flow analysis, DAG representation, code optimization, and three address code generation. Students were asked to attempt any 3 questions from the list in the allotted time of 1 hour.

Uploaded by

api-3812391
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

3rd Sess Comp

The document contains 5 questions related to compiler design on the topics of syntax directed translation, global data flow analysis, DAG representation, code optimization, and three address code generation. Students were asked to attempt any 3 questions from the list in the allotted time of 1 hour.

Uploaded by

api-3812391
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

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<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) a(a+b)*bb
(ii) (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) 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)

Q.4) What are the applications of Global data flow analysis


and DAG.

_______________________________

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy