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

cse-7-sem-language-processor-jun-2017

Uploaded by

aasthalalwani211
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

cse-7-sem-language-processor-jun-2017

Uploaded by

aasthalalwani211
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

B.E. Seventh Semester (Computer Science & Engineering) (C.B.S.

)
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) What are compiler writing tools. 5


OR
2. a) Explain block diagram of phases of compiler. 7

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) Construct LR (0) parsing table for the grammar 7


S  CC
C  CC | d
OR

4. a) Show that the following grammar is LR(1) but not LALR. 8


S  Aa | bAc | Bc | bBa
A d
Bd

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

6. a) Explain the use of following functions in SDTS, 6


i) gene code ii) backpatch
iii) Merge iv) Make list

b) Give SDTS and three address code of following programent fragment 7


While (a < 10 and C > D) do
if (a < b) then
a=a+b
else
b=a+b

7. a) How different attributes of an identifies in block structured language in stored. 7

b) Give run time storage management for call and return statement. 6

OR

8. a) Explain phrase level error recovery in LR parsing. 7

b) When error is detected in top-down parser? How LL(1) parser recovers from error. 6

9. a) What are different optimizations are perform on loops. 6

b) How loops are detected in three address code. 7

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

11. a) What are the issues in the design of code generator. 7

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

12. a) Explain the use of labeling algorithm with example. 7

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

You might also like