Tuesday, July 3, 2012

B. Tech Degree VI Semester Examination, April 2009 CS 601 COMPILER CONSTRUCTION (2006 Scheme) CUSAT


B. Tech Degree VI Semester Examination, April 2009
CS 601 COMPILER CONSTRUCTION
(2006 Scheme)
Time : 3 Hours Maximum Marks : 100
PART - A
(Answer ALL questions)
(8 x 5 40)
(a) Explain the role of a lexical analyzer,
(b) Describe the terms tokens, patterns and lexemes.
(c) What is the difference between top down parsing and bottom up parsing?
(d) Compare recursive descent parser with predictive parser.
(e) What is type checking? What are the functions of a type checker?
(0 Differentiate between synthesized and inherited attributes.
(g) Explain the implementation of three address statements.
(h) Explain peep-hole optimization.
II. IlL PART — B
Explain the different phases of a compiler.
OR
What is the role of transition diagram in the construction of lexical analyzer? Draw the transition diagram for identifTer and keywords.
IV. Explain LR parsing algorithm. Construct LR parsing table for the grammar .
E -> E
T -> T * F
TF
F -> (E)
F --> id (15)
OR
V. Explain with appropriate examples operator precedence parsing. (15)
VI. Explain the different storage allocation strategies. (15)
OR
VII. Explain the different parameter — passing mechanisms. (15)
VIII. What are the principal sources of optimization in a code? Illustrate with suitable
examples. (15)
OR
Ix. Explain the different issues in the design of a code generator. (15)

No comments:

Post a Comment