100% found this document useful (1 vote)
685 views1 page

15A05601 Compiler Design

The document is an exam for a Compiler Design course covering 5 units: 1) Lexical analysis and parsing 2) Parsing techniques like CLR parsing 3) Code generation including back patching and three-address code 4) Symbol tables and memory allocation 5) Code optimizations like common subexpression elimination and induction variable elimination It contains 11 short answer questions testing knowledge of input buffering, regular expressions, ambiguous grammars, parser generation, syntax-directed translation, attributed grammars, symbol table operations, stack memory, basic blocks, loop optimization, finite automata, parsing, back patching, code representations, symbol tables, activation records, DAGs for dataflow analysis, and peephole optimizations.

Uploaded by

Rasamsetty Anu
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
100% found this document useful (1 vote)
685 views1 page

15A05601 Compiler Design

The document is an exam for a Compiler Design course covering 5 units: 1) Lexical analysis and parsing 2) Parsing techniques like CLR parsing 3) Code generation including back patching and three-address code 4) Symbol tables and memory allocation 5) Code optimizations like common subexpression elimination and induction variable elimination It contains 11 short answer questions testing knowledge of input buffering, regular expressions, ambiguous grammars, parser generation, syntax-directed translation, attributed grammars, symbol table operations, stack memory, basic blocks, loop optimization, finite automata, parsing, back patching, code representations, symbol tables, activation records, DAGs for dataflow analysis, and peephole optimizations.

Uploaded by

Rasamsetty Anu
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/ 1

Code: 15A05601 R15

B.Tech III Year II Semester (R15) Regular Examinations May/June 2018


COMPILER DESIGN
(Common to CSE & IT)
Time: 3 hours Max. Marks: 70
PART – A
(Compulsory Question)
*****
1 Answer the following: (10 X 02 = 20 Marks)
(a) What is the role of input buffering in lexical analyzer?
(b) Write a regular expression for a constant.
(c) What is ambiguous grammar? Give an example.
(d) Write a code segment for parser generator to generate a parse tree of an expression.
(e) Write syntax directed translation scheme for infix to postfix conversion.
(f) What is L-attributed definition?
(g) What are the operations required on a symbol table?
(h) What is the use of stack memory?
(i) What is basic block?
(j) Why loop optimization is so important than other code optimization?

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 (a) Show the sequence output of each phase of a compiler for the following code segment:
int x = 5, y = 10,z; z = x+ y*5; printf(“%d”, z);5.
(b) Write a LEX program for a C programming language.
OR
3 (a) Explain about state minimization of finite automata.
(b) Construct NFA and find DFA for a pattern recognition of (a/b)*abb.
UNIT – II
4 Construct CLR parsing for the following grammar:
S→ CC
C→ cC/d
OR
5 (a) What is unambiguous grammar? Give an example for ambiguous grammar.
(b) Write a code for parser generator of an assignment and if-then-else statement.
UNIT – III
6 (a) What is meant by back patching? Show back patching in a Boolean expression.
(b) Discuss various types of three address code representation for the following code segments:
x = x+y*10; z = x;
OR
7 Write SDT to generate intermediate code for assignment statement. Give an example.
UNIT – IV
8 (a) Describe about symbol table organization for block structured language.
(b) Explain how to allocate heap memory space for dynamic memory allocation.
OR
9 (a) Describe about various representations of symbol table.
(b) What is activation record? Explain the structure of an activation record.
UNIT – V
10 (a) What is direct acyclic graph? Explain how this is useful for dataflow analysis.
(b) Describe the following: (i) Common sub expression. (ii) Induction variable elimination.
OR
11 Describe about various peephole techniques with examples.
*****

You might also like