0% found this document useful (0 votes)
50 views3 pages

CD Ese Paper 2019

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

CD Ese Paper 2019

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Sanjay Ghodawat University, Kolhapur 2019 - 20

Established as State Private University under Govt. of Maharashtra. Act No XL, EXM/P/09/01
2017
Year and Program:2018-19 School of Technology Department of Computer
Science & Engineering
Course Code : CST305 Course Title: Compiler Design Semester – V
Day and Date : End Semester Examination (ESE) Time: Max Marks: 100

Instructions:
1) All questions are compulsory.
2) Assume suitable data wherever necessary.
3) Figures to the right indicate full marks.

Q.1 Attempt the Following Marks Bloom’ CO


s
Level
a) Describe Pass - I algorithm of absolute loader with basic functions 07 L2 CO1
performed by the absolute loader.
OR
a) Describe the application of compiler technology in implementation of High 07 L2 CO1
level programming languages.
b) How The dangling else ambiguity is resolved by the parser? 08 L1 CO2
OR
b) Construct a predictive parser for a given LL(1) class of a grammar and give 08 L3 CO2
the derivation steps to derive a string w=”abfg”.
S-> A
A->aB| Ad
B->bBC|f
C→g

Q.2 Attempt the Following


a) Illustrate the model and algorithm of LR(K) parsers. 08 L2 CO2
OR
a) Construct the Canonical (CLR) parser table the LR(K) class of grammar. 08 L3 CO2
G={V={E, T, OP}, ∑={a,b,+},S=E } and production rules are
P = { E -> T OP T
T -> a
T -> b
OP -> + }
b Discuss S - Attributed Definition and L - Attributed Definition and 07 L2 CO3
construct an Abstract Syntax Tree (AST) for a string w = a – 4 + c by using
the given grammar.
E -> E1 + T
E -> E1 - T
E->T
T -> ( E )
T -> id
T ->num
OR
b) Construct Syntax Directed Definition (SDD) and Dependency graph for 07 L3 CO3
Simple declaration statements float ide1, ide2, id3.
D -> T L
T -> int
T -> float
L -> L1 , id
L -> id

Q. 3 Solve any Two


a Explain features of machine dependent loader. 08 L2 CO1
b G = {bexpr, {bexpr, bterm, bfactor},{not, or, and, (, ), true, false}, P } 08 L2 CO2
with P given below.
bexpr → bexpr or bterm | bterm
bterm → bterm and bfactor | bfactor
bfactor → not bfactor | ( bexpr ) | true | false
For this grammar answer the following questions:
(A) Remove left recursion from G.
(B) Left factor the resulting grammar in (A).

c Construct the LR(0) parser for the given grammar, G = ( V={S,C }, 08 L3 CO2
∑={c,d},S={S} and
P= { S -> CC
C->cC
C -> d })
d Apply Syntax Directed Definition (SDD) to draw an Annotated Parse Tree 08 L3 CO3
for a Simple desk calculator to generate a string 3 * 5 + 4n

Q. 4 Solve any Two.


a Translate the given arithmetic expression into a) Abstract Syntax Tree b) 09 L2 CO4
Quadruples c) Triples.
1) a + -(b + c) 2) a =b * -c + b* -c
b Apply algorithm for partitioning three - address instructions into basic 09 L3 CO4
blocks, flow graphs and loops.
c Construct the basic blocks and flow graphs for the given three address code 09 L3 CO4
to set a 10 X 10 matrix to an identity matrix and also shows the loops if
exist.
1) i=1
2) j=1
3) t1 = 10 * i
4) t2 = t1 + j
5) t3 = 8 * t2
6) t4 = t3 - 88
7) a[t4] = 0.0
8) j = j+1
9) if j<=10 goto (3)
10) i = i+1
11) if i=10 goto (2)
12) i = 1<
13) t5 = i -1
14) t6 = 88 * t5
15) a[t6] = 1.0
16) i=i+1
17) if i<= 10 goto (13)

Q. 5 Solve any Two.


a Show the use of Directed Acyclic Graph (DAG) in optimization of the code 09 L3 CO4
represented through the basic blocks.
b Discuss the code redundancy, global common sub expression and copy 09 L3 CO4
propagation principle source of code optimization.
c Analyze the Peephole Optimization technique to optimize the target code 09 L4 CO4
effectively.

Q. 6 Solve any Three


a Describe the Type Conversion with an example. 06 L2 CO4
b Explain the need of Back patching technique. 06 L4 CO4
c Write an algorithm to eliminate common sub expression. 06 L1 CO4
d Explain any three issues in design of code generator. 06 L2 CO4

You might also like