Professional Documents
Culture Documents
6 CSE-CS2352 - AB-17!4!13 - Principles of Compiler Design Model
6 CSE-CS2352 - AB-17!4!13 - Principles of Compiler Design Model
Sixth Semester
Computer Science and Engineering
CS2352 PRINCIPLES OF COMPILER DESIGN
Maximum : 100 marks
Answer ALL questions
11. a) What is a compiler? Explain the various phases of compiler in detail with a
neat sketch.
(16)
Or
(12)
(16)
S (L) | a
L L, S | S
and check whether the following sentences belong to that grammar or not.
(i) (a, (a, a))
(16)
(a) (i) Define three-address code. Describe the various methods of implementing threeaddress statements with an example.
(8)
(ii) Give the translation scheme for converting the assignments into three address code. (8)
Or
(b) (i) Discuss the various methods for translating Boolean expression.
(8)
(ii) Explain the process of generating the code for a Boolean expression in a single
pass using back patching.
14. (a) i) Explain the issues in design of code generator.
ii) Explain Simple Code Generator with Code Generation algorithm?
(8)
(8)
Or
(b) i) Define basic block. Write an algorithm to partition a sequence of three-address
statements into basic blocks
(10)
ii) What are the steps needed to compute the next-use information?
(6)
15. (a) Why do we need Code optimization? Explain the principle sources of
optimization.
(16)
Or
(8)
(8)