Compiler Design Oct-Nov 2019
Compiler Design Oct-Nov 2019
Compiler Design Oct-Nov 2019
3. a) Define Context Free Grammar. Explain how it is suitable for parsing? [7M]
b) Write an algorithm to find LR(0) items and give an example. [7M]
6. a) What is a flow graph? Explain how flow graph can be constructed for a given [7M]
program.
b) Discuss the advantages and disadvantages of heap storage allocation strategy. [7M]
*****
|''|''|||''|'''|||'|
Code No: R1631051 R16 SET - 2
5. a) What is the role of type checking in error detection and error recovery? Explain. [7M]
b) Give the translation scheme to convert an expression grammar into three address [7M]
code.
6. a) Explain the activities of caller and callee in stack allocation strategy with an [7M]
example. What is the role of parameter passing in it?
b) How to access non-local data? Explain with example. [7M]
*****
|''|''|||''|'''|||'|
Code No: R1631051 R16 SET - 3
4. a) State and explain the rules used to construct the LR(1) items. [7M]
b) Discuss the evolution order of SDTs. Also write its applications. [7M]
5. a) What is a three address code? What are its types? How it is implemented? [7M]
b) What are the one-pass code generation methods? Explain any one. [7M]
7. a) Prove that simple code generation algorithms allocate the registers efficiently. [7M]
b) Discuss the transformations that are characteristic of peephole optimizations. [7M]
*****
|''|''|||''|'''|||'|
Code No: R1631051 R16 SET - 4
III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2019
COMPILER DESIGN
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Note: 1. Question Paper consists of two parts (Part-A and Part-B)
2. Answer ALL the question in Part-A
3. Answer any FOUR Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A (14 Marks)
1. a) Define Boot strapping. [2M]
b) Give the rules to find the first function. [2M]
c) List the properties of LR parser. [2M]
d) How is object code different from intermediate code generation? [3M]
e) Write the limitations of access links. [3M]
f) What is peephole? What peephole optimizations can be performed on code? [2M]
3. a) What is an LL(1) grammar? Can you convert every context free grammar into [7M]
LL(1).
b) Consider the following grammar [7M]
E -> T + E|T
T -> V*T|V
V -> id
Write down the procedures for the non-terminals of the grammar to make a
recursive descent parser.
5. a) What is the role of type system in type checker? Write the syntax directed [7M]
definition for type checker.
b) Explain the steps involved in partitioning a sequence of three address statements [7M]
into basic blocks.
6. a) What is runtime stack? Explain the storage allocation strategies used for recursive [7M]
procedure calls.
b) Discuss about register allocation and assignment in target code generation. [7M]
*****
|''|''|||''|'''|||'|