You are on page 1of 3

uptuonline.com uptuonline.

com

Printed Pages-3 EC5603

lowing Paper ID and Roll No. to be filled in yourAnswer Book

B.Tech.
(sEM. VD THEORY EXAMTNATTON 20 l 3- 1 4
COMPILERDESIGN

Time :3 Hours Total Marl<s : 100

Note :- (1) Atternpt all questions. Each question carries equal


marks.
(2) Be precise and to the point while answering.
l. Attempt any four parts : (5x4=20)
(a) Describe the synthesis-analysis model ofcompiler.
(b) What are different compiler tools ? Discuss any two.
(c) Remove left recursion from the grammar
E-+E(r)lT
T+T(F)lF
F-+id
(d) What do you mean by ambiguous grammar ? Show that
the follorving grammar is ambiguous.

S+aSbSlbSaSle
(e) Define boot-strapping with the help of an example.
(0 Explain the term token, lexeme and Pattern.
2. Attempt any two parts : (10x2=20)
(a) What do you mean by operator precedence grammar ?

ECS60,/DQJ-2t7s2 [Turn Over

uptuonline.com
http://www.UPTUonline.com
http://www.UPTUonline.com
uptuonline.com uptuonline.com
Compute the operator precedence table for the given
grammar.
E-+E+TlT
T+T*FlF
F+(E)lid
(b) Differentiate between Recursive Decent Parsing and
Predietive Parsing. Derive the LL (l) parsing table for the
following grammar

bexpr + bexpr or bterm I bterm


bterm -+ bterm and bfactor I bfactor

bfactor -+ not bfactor | (bexpr) | true I false

(c) Showthatthe following grammar

S+AalbAclBclbBa
A-+d
il

B+d
is L R (l) but not LALR (l).
3. Attempt any two parts : (10x2=20)

(a) Define Syntax Directed Translation. Construct an


annonated parse tree for the expression (4 * 7 + l) + 2,

using the simple desk calculator grammar.

(b) What are different ways to write three address code ?


Write the three address code forthe following code segment :

WhileA<CandBcDdo
ifA=lthenC=g+l
else while A < = D do A= A+ 2.

ECS603IDQJan52

uptuonline.com
http://www.UPTUonline.com
http://www.UPTUonline.com
uptuonline.com uptuonline.com
(c) Define backpatching and semantic rules for boolean
expression. Derive the three address code for the following
expression

P<QandR<SandT<U
4. Attempt any two parts : (10x2=20)
(a) What is the role of synrbol table ? Discuss different data
structures used for symbol table.

(b) What are lexical phase errors, syntactic phase erors and
semantic phase errors ? Explain with suitable example.

(c) Why run-time storage management is required ? How


simple stack implementation is implemented ?

5. Attempt any two parts : (10x2=20)


(a) What is DAG ? How DAG is created from three address
code ? Write algorithm for it and explain it with a relevant
example.

(b) What are different issues in code optimization ? Explain it


with properexample.
(c) Write short notes (any two) :

(r) GlobalDataFlowAnalysis
(iD Loopunrolling
(iiD LoopJamming.

ECS603/DQJ-21752 15625

uptuonline.com
http://www.UPTUonline.com
http://www.UPTUonline.com

You might also like