Compiler Design Aug 2021

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Code No: R1631051 R16 SET - 1

III B. Tech I Semester Supplementary Examinations, August - 2021


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) Describe the operation performed by scanner of compiler. [2M]
b) Write about top-down parsing brute force technique with example. [2M]
c) Discuss the operation of Shift on LR(1) items. [2M]
d) What is the use of flow back patching technique? Give example. [3M]
e) Explain the features which affect the organization of data. [3M]
f) Write about elimination of redundant operations. [2M]
PART –B (56 Marks)
2. a) How to specify the tokens? Differentiate token, lexeme and pattern [7M]
with suitable examples.
b) Generate object code for x1=x2*x3/15 through different phases of [7M]
compiler.

3. a) Discuss the following: i) Left Recursion; ii) Left factoring. [7M]


b) Compute first and follow functions for the given grammar: [7M]
EE+T|T TT*F|F FF*|a|b.

4. Develop LR parser for the given grammar and check the acceptance of [14M]
input string of your own: RR+|+R|RR|R*|(R)|a|b.

5. a) Write and explain semantic rules for flow-of-control statements like [7M]
if-then, do-while and switch-case.
b) Convert the following expression into syntax tree and three address [7M]
code: h=(b*-(a+b)/d)-c+6.

6. a) What are the issues to be considered while generating code? Explain [7M]
with code generation algorithm.
b) Explain division of tasks between caller and callee in stack allocation [7M]
scheme.

7. a) Write short notes on: i) Instruction Scheduling; ii) Elimination of Loop [7M]
invariant variable.
b) Explain the equation for identifying live variables in a given flow [7M]
graph with dataflow analysis.

*****

|''|''|||''|'''|||'|

You might also like