cse-7-sem-language-processor-jun-2017
cse-7-sem-language-processor-jun-2017
)
Language Processor
P. Pages : 3 NKT/KS/17/7488
Time : Three Hours *0114* Max. Marks : 80
_____________________________________________________________________
Notes : 1. All questions carry marks as indicated.
2. Solve Question 1 OR Questions No. 2.
3. Solve Question 3 OR Questions No. 4.
4. Solve Question 5 OR Questions No. 6.
5. Solve Question 7 OR Questions No. 8.
6. Solve Question 9 OR Questions No. 10.
7. Solve Question 11 OR Questions No. 12.
8. Due credit will be given to neatness and adequate dimensions.
9. Assume suitable data whenever necessary.
1. a) What is mean by phase and a pass of a complier? Explain lexical analysis phase of a 9
compiler in detail.
b) Write a LEX program to identify real constants in a text file. Real constants may be 7
represented in floating point format or exponential format.
3. a) What is the significance of FIRST and FOLLOW in top down parsers? "A E-free 6
grammar can be parse using LL(1) parsing table without FOLLOW set" Justify the
statement.
b) Shift-Reduce parser carries out the action within braces immediately after reducing with 5
corresponding rule of the grammar.
S x Wx print "1"
S y Print "2"
W Sz Print "3"
What is the translation of
i) xxyzxzx
Show all the stops of reduction.
NKT/KS/17/7488 1 P.T.O
5. a) What are different types of intermediate codes? Comment following statement into all 6
intermediate code.
a SQRT b b 4 a c / 2 a .
b) Give SDTS and generated three address code for the following statement 7
A i, B [k] B i k A i , k
assume array A is of size 20 x 30 and
B is of size 30, and
bpw = 04
OR
b) Give run time storage management for call and return statement. 6
OR
b) When error is detected in top-down parser? How LL(1) parser recovers from error. 6
OR
10. a) What is data flow equations? Solve data flow equations for the following flow graph. 8
1. I = 2
B1
2. J = I +1
B2 3. I = 1
B3 4. J = J + 1
B4 5. J = J - 4
B5
NKT/KS/17/7488 2
b) Explain the use of DAG in code optimization. 5
b) Use simple code generator to generate code for following three address code. 7
t1 a b
t2 c d
t3 e t 2
t 4 t1 t 3
OR
b) How algebraic properties are need to reduce register requirement during code generation. 7
*********
NKT/KS/17/7488 3 P.T.O
NKT/KS/17/7488 4