Download AKTU (Dr. A.P.J. Abdul Kalam Technical University (AKTU), formerly Uttar Pradesh Technical University (UPTU) B-Tech 6th Semester (Sixth Semester) 2018-2019 RCS602 Compiler Design Question Paper
Paperld- R?"N?-\ \ t t t t t t t t \
BTECH
(SEM VI) THEORY EXAMINATION 2018-19
COMPILER DESIGN
T ime: 3 Hours T and Marks: 70
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
1. Attempt all questions in brief. 2 x 7 = 14
a. What are the two parts of a compilation? Explain brie?y.
b. What is meant by Viable prefixes?
c. What are the classifications of a compiler?
(1. List the various error recovery strategies for a lexical analysis.
e. What is dangling else problem?
f. What are the various types of intermediate code representation?
g. Define peephole optimization.
SECTION B
2. Attempt any three of the following: 7 x 3 = 21
a. Write the quadruples ,triple and indirect triple for the following expression:
(X+y)*(y+z)+(x+y+z)
b- What are the problems with top down parsing? Write the algorithm for FIRST
and FOLLOW.
C. Perform Shift Reduce Parsing for the given input strings using the grammar
S->(L)|a
L?>L,S|S
i) (a.(a,a))
ii) (a,a)
d- What is global data ?ow analysis? How does it use in code optimization?
e. Construct LR(0) parsing table for the following grammar
S?> CE | ccA
A->cA | a
B?> ccB | b
SECTION C
3. Attempt any one part of the following: 7 x 1 = 7
(a) Convert following NFA to equivalent DFA and hence minimize the number
of states in the DFA.
Printed Pagesz2 Sub CodezRCS602
(b) Explain the various parameter passing mechanisms of a high level language
4. Attempt any one part of the following: 7 x 1 = 7
(a) How would you represent the following equation using DAG?
a:=b*-c+b*-c
(b) Distinguish between static scope and dynamic scope. Brie?y explain access to
non?local names in static scope.
5. Attempt any one part of the following: 7 x 1 = 7
(a) Write short notes on the following with the help of example:
(1) Loop unrolling
(ii) Loop Jamming
(iii) Dominators
(iv) Viable Prefix
(b) Draw the format of Activation Record in stack allocation and explain each field
in it.
6. Attempt any one part of the following: 7 x 1 = 7
(a) Write down the translation procedure for control statement and switch
statement
(b) Define Syntax Directed Translation. Construct an annotated parse tree for the
expression (4 * 7 + 1) * 2, using the simple desk calculator grammar.
7. Attempt any one part of the following: 7 x 1 = 7
(a) Explain in detail the error recovery process in operator precedence parsing
method.
(b) Explain what constitute a loop in ?ow graph and how will you do loop
optimizations in code optimization of a compiler.
This post was last modified on 29 January 2020