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

It 7 Sem Compiler Design Winter 2018

This document is an examination paper for the B.E. (Information Technology) Seventh Semester course on Compiler Design. It includes various questions covering topics such as compiler phases, parsing techniques, memory allocation, optimization techniques, and code generation. Students are instructed to answer specific questions and are assessed on neatness and adequate dimensions in their responses.

Uploaded by

Sharad Dwivedi
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)
12 views

It 7 Sem Compiler Design Winter 2018

This document is an examination paper for the B.E. (Information Technology) Seventh Semester course on Compiler Design. It includes various questions covering topics such as compiler phases, parsing techniques, memory allocation, optimization techniques, and code generation. Students are instructed to answer specific questions and are assessed on neatness and adequate dimensions in their responses.

Uploaded by

Sharad Dwivedi
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/ 2

B.E. (Information Technology) Seventh Semester (C.B.S.

)
Elective-I : Compiler Design
P. Pages : 2 NIR/KW/18/3588
Time : Three Hours *1843* 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.

1. a) Describe various phases of compiler. 8

b) What are errors that may encounter in each phase of a compiler. 5


OR
2. a) Draw and explain the structure of realistic compiler. 5

b) Explain the following term : 8

i) Cross Compiler

ii) YAAC tool

3. a) Construct LR (0) parsing table for the grammar 8


E → E + E | E  E | (E) | id
Using the standard associativity rules and precedence of operators. Eliminate conflict in
parsing table if any.

b) Explain Bottom – up parsing techniques with example. 6


OR
4. a) Compare LALR and SLR parsing techniques. 6

b) Construct the parsing table for SLR (1) and test whether the grammar is SLR (1) or not for 8
following grammar :
G =  S → PQP
P → aP | 
Q → bQ | 
}

5. a) Give SDTS for mixed mode arithmetic expression. 6

b) What do you mean by TAC? Represent the following expression into quadruples, triples 7
and indirect triples.
− (a + b) + d + (d  (a + b)) + ((a − b)  r)
OR
NIR/KW/18/3588 1 P.T.O
6. Give SDTS for array translation. Generate three address code for the statement 13
A[i, j, k] = B[i, j] + C[i + j]
Where
array A is of size 10  20  30
array B is of size 10  20 and
array C is of size 30
assume bpw = 4

7. a) Explain memory allocation in procedure call and return statement. 6

b) What is the need of symbol table? Explain the data structure for symbol table management. 7

OR

8. a) Describe different storage allocation strategies. 6

b) Explain the error recovery in LL Parsers. 7

9. a) What are different loop optimization techniques? Explain. 7

b) What are the principle sources of optimization? Also write importance of code optimization. 7

OR

10. a) Find IN and OUT for the following flow graph. 7

i=2
B1
j=j+1

I= 1
B2

j=j+1 B3

B4 j=j-4 j=j+2 B5

b) Write the steps of algorithm for partitioning a sequence of three – address statements into 7
basic blocks.

11. a) Explain the use of DAG in code generation. 8

b) Write a short note on peephole optimization. 5


OR
12. Write short note on any two. 13
i) Heuristic ordering of DAGs.
ii) Labeling algorithm.
iii) Code generation from DAG.
***********

NIR/KW/18/3588 2

You might also like