Semester : SEMESTER 6
Subject : Compiler Design
Year : 2019
Term : MAY
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 304
Page:2
10
11
12
13
14
15
16
17
18
19
20
a)
b)
a)
b)
a)
a)
a)
a)
a)
a)
b)
a)
b)
F1031 Pages: 2
PART (^
Answer all questions, each carries3 marks.
Explain the main actions in a shift reduce parser
What are different parsing conflicts in SLR parsing table?
What are annotated parse trees? Give examples.
What are L-attributed definitions and S-attributed definitions in a syntax directed
translation scheme?
PART D
Answer any two full questions, each carries9 marks.
Find the LR(0) items for the grammar
S->SS | ॥| ©.
Explain bottom- up evaluation of s-attributed definitions.
Derive LALR (1) parsing algorithm for following grammar
S>AS/b
A>SA/a
Design a type checker for simple arithmetic operations.
Explain the syntax directed definition of a simple desk calculator.
Explain operator grammar and operator precedence parsing
PART E
Answer any four full questions, each carries10 marks.
Explain storage organization and storage allocation strategies
Explain intermediate code generation of an assignment statement
Explain quadruples, triples and dags with an example each.
Explain the principal sources of optimization
Explain optimization of basic blocks
With suitable examples explain loop optimization.
Explain issues in design of a code generator
Explain simple code generation algorithm
Page 2 of 2
(3)
(3)
(3)
(3)
(4)
(5)
(6)
(3)
(5)
(4)
(10)
(10)
(10)
(10)
(5)
(5)
(5)
(5)