0% found this document useful (0 votes)
27 views40 pages

Compiler Design Merged

This document outlines the chapters and questions covered in the Compiler Design course. Chapter 1 discusses bootstrapping of compilers and constructing DFAs from regular expressions. Chapter 2 covers left recursion in parsers, constructing parsing tables, and shift-reduce parsing. Chapter 3 defines synthesized attributes and bottom-up parsing of arithmetic expressions. Chapter 4 discusses symbol tables, activation records, parameter parsing, and memory allocation strategies. Chapter 5 defines DAGs and discusses code generation issues like global data flow analysis and induction variable elimination.

Uploaded by

PUBG gamer
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)
27 views40 pages

Compiler Design Merged

This document outlines the chapters and questions covered in the Compiler Design course. Chapter 1 discusses bootstrapping of compilers and constructing DFAs from regular expressions. Chapter 2 covers left recursion in parsers, constructing parsing tables, and shift-reduce parsing. Chapter 3 defines synthesized attributes and bottom-up parsing of arithmetic expressions. Chapter 4 discusses symbol tables, activation records, parameter parsing, and memory allocation strategies. Chapter 5 defines DAGs and discusses code generation issues like global data flow analysis and induction variable elimination.

Uploaded by

PUBG gamer
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/ 40

BE (Sixth Semester)

Computer Science Engineering


Compiler Design - 322652(22)
2015 - Summer Session , New Scheme
Chapter 1
1 List out two significances of bootstrapping of a compiler. 2
*
2 Convert the given language (a+b) abb into DFA using subset construction algorithm. Also
minimize the no. of states to have the minimized DFA.? 7
3 Draw the transition diagram that recognizes:
(i) Identified with underscore (ii) Signed integer (iii) Signed real number (iv) White space
(v) C-relational operators (vi) Floating point exponent constant (vii)GOOOO.....,..GLE.
4 Write LEX source program specification for the token BEGIN | ENG | THEN | ELSE |
letter (letter | digit)* 7
Chapter 2
1 What is the problem of left-recursion in top-down parser? Give suitable example. 2
2 For the following grammar with E as the start symbol, find the FIRST and FOLLOW sets
of each of the non-terminal:

E -> TE'
E' -> +TE' |
T -> FT'

Also, construct the predictive parsing table for the above mentioned grammar. 7
3 For the following grammar:
E -> E +E E -> E * E E -> (E) E -> id
Generate the sequence of actions taken by the shift-reduce parser for parsing the input string
id1 + id2 * id3 7
4 Explain, how operator procedure parsing relations table is created for evaluating arithmetic
expressions with example. 7
Chapter 3
1 What is synthesized attributes ? 2
2 Give a syntax-directed translation scheme for a " desk calculator" and show the sequence of
moves made by bottom-up-parser of the input 12 * 5 + 4 $. 7
3 Translate the expression
a : = b * - c + b * - c into
(i) Quadruples
(ii) Triples
(iii) indirect triples
4 Translate the following statement into the equivalent three- address code :
IF ( a > b && c < d ) sum = sum + xi
else sum = sum -xi 7
Chapter 4
1 What is symbol table ? 2
2What is the use of activation record ? Explain different fields in the activation record. 7
3Write short notes on the following:
(i) Parameter parsing technique
(ii) Activation trees 7
4Differentiate between static, stack and heap allocation strategies. 7
Chapter 5
1 What is DAG ? 2
2Explain in brief issues in the design of the code generator. 7
3Write short notes on the following :
(i) Global data flow analysis (ii) Induction variable elimination. 7
4Construct the DAG for the following expressions : 7
a + a * ( b - c ) + ( b - c) * d

You might also like