cse-7-sem-language-processor-2015
cse-7-sem-language-processor-2015
cse-7-sem-language-processor-2015
MVM—47659 1 Contd.
www.rtmnuonline.com
10. (a) What is dominator ? Construct dominator tree for 4. (a) What is Augmented grammar ? Why there is a need
the following graph. Also detect Back edges from to have Augmented Grammar while constructing LR
the given graph. 7 parsers ? Explain with suitable example. 4
1
(b) Construct LR(1) Parsing Table for the given grammar.
2 S → AaAb
3
S → BbBa
4 A→ ∈
B → ∈. 9
5 6
5. (a) Write SDTS to generate TAC for the given Boolean
7 Expression :
E → E + E {Print "+"}
9 10
E → E * E {Print "*"}
E → id [Print id.name}
(b) Write short note on Loop Unrolling and Loop Jamming.
6 Convert infix id + id * id into postfix. 5
OR
www.rtmnuonline.com
www.rtmnuonline.com
6. Generate three address code using SDTS for following : 9. Compute IN and OUT equations for following graph.
13
A[I, J, K] = B[I, J] + C [I + J + K]
(1) I = 2
where
B1 (2) J = J + 1
A is 3D array of size 10 × 10 × 10
B is 2D array of size 10 × 10
B2
(3) I = 1
C is 1D array of size 30
bpw = 2
OR B5
www.rtmnuonline.com
www.rtmnuonline.com
1. (a) Explain various phases of compiler in detail. 8 11. (a) Apply Heuristic ordering algorithm to detect optimal
(b) Write short note on implementation of Lexical Analysis. sequence and then generate optimal code for that
Also explain structure of LEX. 6 sequence using two registers R0 and R1 for the
following code :
OR
T1 = a + b
2. (a) Write a LEX program to recognize keyword if/then T2 = c + d
else; identifier; constant. 6 T3 = e – T2
T4 = T1 – T3 . 9
(b) State the difference between pass and phase of
compiler. 4 (b) Explain different design issues for a good code
generator. 4
(c) What is cross compiler ? Explain how boot-strapping OR
is used in design of a compiler. 4
12. (a) Give labelling algorithm and determine number of
3. (a) Explain why we remove left recursion and perform registers required to evaluate following instruction
left factorization for the given CFG while constructing set:
LL(1) parser. 4 T1 = a + b
T2 = c + d
(b) Construct LL(1) parsing table for the given grammar.
T3 = e + f
A → aCDq | aBg | ∈
T4 = T2 + T3
C → p | ∈ | Ct | BD | rAB T5 = T4 + T1 . 6
B → e | ∈. 9
OR
www.rtmnuonline.com