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

Compiler Design Dec 2023

previous question papers for csd

Uploaded by

Syed Moin
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)
48 views

Compiler Design Dec 2023

previous question papers for csd

Uploaded by

Syed Moin
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/ 4

Code No: R2031421 R20 SET - 1

III B. Tech I Semester Regular/Supplementary Examinations, December -2023


COMPILER DESIGN
CSE(AIML),CSE(AI),CSE(DS),CSE(AIDS),AIDS,AIML& CSD
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

UNIT-I
1 Illustrate the phases of a compiler indicating the inputs and outputs of each [14M]
phase in translating the statement “amount = principle + rate * 36.0 ”.
(OR)
2 a) Explain how Lexical analyzer is generated using LEX? [7M]
b) Write short notes on input buffering [7M]
UNIT-II
3 a) Define parser and discuss the role of parser in compilation process. [7M]
b) Explain the term ambiguous grammar with appropriate example. [7M]
(OR)
4 a) Compare bottom-up approaches of parsing with top-down approaches [7M]
b) Discuss how Brute-Force approach operates in top down parsing? [7M]
UNIT-III
5 Construct SLR parsing table for the flowing grammar [14M]
EE+T/T
T T*F/F
F (E)/id .
(OR)
6 a) Write short notes on syntax Directed Definition. [7M]
b) Discuss the evaluation of semantic rules in SDDs. [7M]
UNIT-IV
7 a) How symbol table can be managed? Explain. [7M]
b) Discuss storage allocation for block structured languages [7M]
(OR)
8 a) Write the quadruple, triple, indirect triple for the expression [7M]
(a*b) + (c+d)-(a+b+c+d).
b) Write an algorithm for constructing the dependency graph for a given parse [7M]
tree?
UNIT-V
9 List and discuss the issues in the design of a code generator [14M]
(OR)
10 a) Explain with an example optimization of Basic blocks [7M]
b) Describe with suitable example various sources of loop optimization [7M]

1 of 1

|''|''|||''|'''|||'|
Code No: R2031011
R2031421 R20 SET - 2

III B. Tech I Semester Regular/Supplementary Examinations, December -2023


COMPILER DESIGN
CSE(AIML),CSE(AI),CSE(DS),CSE(AIDS),AIDS,AIML& CSD
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

UNIT-I
1 a) Discuss in detail about the role of Lexical analyzer in compiler [7M]
construction
b) Elaborate on the issues in Lexical analysis. [7M]
(OR)
2 a) Define Compiler. What is the importance of Compiler? [7M]
b) Write short notes on Finite Automata and its applicability in compilers. [7M]
UNIT-II
3 a) Explain various types of bottom-up parsers with example. Write the steps [9M]
to construct LR(0) parsing table.
b) Compare left recursion with left factoring with suitable example. [5M]
(OR)
4 a) Explain the LR parsing algorithm with an example. [7M]
b) Write short notes on Left Factoring. Give its significance in syntax [7M]
analysis.
UNIT-III
5 Find the SLR parsing table for the given grammar and parse the sentence [14M]
(a + b) ∗c
E → E + E/E ∗ E/ (E) /id .
(OR)
6 a) How do you implement syntax directed definitions? Explain intermediate [10M]
form of source program with example.
b) Write Short notes on Three address code. [4M]
UNIT-IV
7 a) What are the various storage allocations in runtime environment? Explain [7M]
them.
b) Discuss the features of stack memory allocation. [7M]
(OR)
8 a) What is an activation record? Explain the role activation record in [7M]
runtime storage allocation.
b) What is a flow graph? Explain with an example. [7M]
UNIT-V
9 a) Explain about various levels and types of optimizations. [7M]
b) Write short notes on peephole optimization. [7M]
(OR)
10 a) What is the role of code Optimizer in compiler? Is it a mandatory phase? [7M]
b) Explain the role of DAG in optimization with example. [7M]

1 of 1

|''|''|||''|'''|||'|
Code No: R2031421
R2031011 R20 SET - 3

III B. Tech I Semester Regular/Supplementary Examinations, December -2023


COMPILER DESIGN
(CSE(AIML),CSE(AI),CSE(DS),CSE(AIDS),AIDS,AIML& CSD
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

UNIT-I
1 a) What is lexical analysis? List out the functions of a Lexical Analyzer. [7M]
b) State the reasons for the Separation of Analyses programs into Lexical, [7M]
Syntax, and Semantic Analyses.
(OR)
2 a) Write short notes on bootstrapping. [5M]
b) Define left recursion. Is the following grammar left recursive? [9M]
E → E+E | E*E| a| b .
UNIT-II
3 a) What is syntax tree? Draw the annotated parse-tree for the input 3*5+4n. [7M]
b) Write Short notes on Recursive Descent Parsing. [7M]
(OR)
4 Define a Parser. What is the role of grammars in Parser construction? [14M]
Construct the Predictive parsing table for the grammar G : E → E+T |T ,
E →T*F |F , F →(E) |id.
UNIT-III
5 a) Construct SLR parsing table for the following grammar: [7M]
R-> R’|’R|RR|R*|(R)|al b .
b) Describe the types of LR parsers. [7M]
(OR)
6 a) Compare the operating mechanism of LR parser with LL parser. [7M]
b) List and Explain the different types of type checking. [7M]
UNIT-IV
7 a) What is DAG? Explain their role in compilation process. [7M]
b) Explain the different storage allocation strategies. [7M]
(OR)
8 a) What is code optimization? Give example for any two optimization [9M]
techniques.
b) What is a flow graph? Explain with an example. [5M]
UNIT-V
9 Write the simple code generation algorithm and generate the code for the [14M]
statement
W:=(A-B) + (A-C) + (A-C) .
(OR)
10 a) Explain the three techniques for loop optimization with examples. [7M]
b) Write Short notes on Register allocation in Code generation. [7M]

1 of 1

|''|''|||''|'''|||'|
Code No: R2031421 R20 SET - 4

III B. Tech I Semester Regular/Supplementary Examinations, December -2023


COMPILER DESIGN
CSE(AIML),CSE(AI),CSE(DS),CSE(AIDS),AIDS,AIML& CSD
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

UNIT-I
1 Discuss the phases of a compiler with suitable example. [14M]
(OR)
2 a) What is LEX? Discuss the usage of LEX in Lexical Analyzer generation. [7M]
b) Write a note on the parse generator '_ YACC. [7M]
UNIT-II
3 a) What do you mean by left factoring the grammars? Explain. [7M]
b) List down the conflicts during shift-reduce parsing. [7M]
(OR)
4 a) List and Explain Pre Processing steps of Top Down Parsing. [7M]
b) Explain about Parse tree with suitable example. [7M]
UNIT-III
5 What is an LR(0) item? Construct an SLR parsing table for the grammar [14M]
G: S→ L=R |R, L → *R | id, R → L. Is it SLR(1) grammar?
(OR)
6 a) Explain bottom up parsing with an example. [7M]
b) What is dangling ELSE ambiguity? How to handle it? [7M]
UNIT-IV
7 a) Define activation records. Explain how it is related with runtime storage [7M]
allocation.
b) What is Run time Environment? Explain in detail. [7M]
(OR)
8 a) Obtain the directed acyclic graph for the expression: [9M]
x+x*(y+ z)+(y+z)* w .
b) Write short notes on Basic block focusing on its optimization. [5M]
UNIT-V
9 a) List and Explain Various possible Outputs of Code Generator. [7M]
b) Discuss Global Register Allocation in code generation. [7M]
(OR)
10 Generate code for the following: [14M]
i) x=f(a)+f(a)+f(a) ii) x=f(f(a)) iii) x=++f(a)
iv) x=f(a)/g(b,c)

1 of 1

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

You might also like