## TOPICS (Click to Navigate)

Please visit, subscribe and share 10 Minutes Lectures in Computer Science

## Anna University Examinations - CS383 Principles of Compiler Design - April May 2014, Computer Science and Engineering (CSE), Sixth Semester, regulation 2004

Exam
B.E/B.Tech. (Full Time) DEGREE END SEMESTER EXAMINATIONS
April May 2014
Subject Code

Subject Name

## Principles of Compiler Design

Branch
Computer Science and Engineering
Semester
Sixth Semester
Regulation
2004

B.E / B.Tech. (Full Time) DEGREE END SEMESTER EXAMINATIONS, APRIL / MAY 2014
Computer Science and Engineering
Sixth Semester
CS383 PRINCIPLES OF COMPILER DESIGN
(Regulations 2004)
Time : 3 Hours                      Answer A L L Questions                Max. Marks 100
PART-A (10 x 2 = 20 Marks)

1. List the phases of a compiler?
2. What is lookahead?
3. Provide the semantic rules for syntax tree generation?
4. Name the data structures available for intermediate code?
5. Compare Dead Vs Unreachable code elimination with suitable examples?
6. Write any four algebraic simplification.
7. What is the use of code hoisting?
8. Name any four procedural optimization techniques?
9. Write the issues in the design of target code
10. What is Machine Idioms.

Part-B (5* 16 = 80 Marks)

11. i) Write algorithm to construct the SLR parsing table and create one for the following Grammar. (16)
E E + T | T
T TF | F
F F * | a |

12. a) Write the semantic rule for control flow statements with backpatch and apply the same to the C code... intx = 0; inti = 0;                                           (16)
while (i < 4)
{ i = i + l;
x = x + i; }
(OR)
b) Write semantic rule for array addressing and generate the parse tree for the high level statement A[i] = B[i, j] + C[i+25, j]                                          (16)

13. a) Explain loop optimization techniques with an example of your choice. (16)
(OR)
b) Explain Partial Redundancy Elimination and Reassociation with example of your choice. (16)

14. a) Write on any six optimization techniques that is specifically applied to procedures
(16)
(OR)
b) Write on any six optimization techniques that is specifically applied to control statements without loops (16)

15. a) Generate optimal code using Dynamic Programming technique for the assignment statement x=(a+b)/(c*d/e). Assume the instructions cost to be equal (16)
(OR)
b) Generate target code using simple codegen algorithm and provide their next use and liveness information for the C code mentioned in question 12 a. (16)

************************