B.Tech Computer Science & Engineering COMPILER DESIGN [Set No. 4] Question paper

Started by aruljothi, Aug 27, 2008, 12:17 PM

Previous topic - Next topic

aruljothi



Code No: R05320502 Set No. 4
III B.Tech II Semester Regular Examinations, Apr/May 2008
COMPILER DESIGN
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
1. (a) Consider the following fragment of 'C' code:
float i, j;
i = i * 70 + j + 2;
Write the output at all phases of the compiler for the above 'C' code.
(b) Write short notes on: input buffering. [10+6]
2. (a) What is recursive descent parser? Construct recursive descent parser for the
following grammar.
E ! E + T|T
T ! TF|F
F ! F|a|b
(b) What is ambiguous grammar? Eliminate ambiguities for the grammar:
E ! E + E|EE|(E)|id. [8+8]
3. Construct SLR parsing table for the following grammar.
S ! AS|b
A ! SA|a
[16]
4. Write short notes on the following:
(a) S-attributed definitions.
(b) L-attributed definitions.
(c) Dependency graph. [6+6+4]
5. (a) What is an ordered and unordered symbol table? What is the function of
symbol table in the compliation process? Explain.
(b) What are the various attributes of a Symbol Table? [10+6]
6. Explain different principal sources of optimization technique with suitable exam-
ples. [16]
7. A flow graph is useful for understanding code generation algorithm? Justify your
answer with an example. [16]
8. Discribe various Register allocation optimization techniques with an example. [16]
1 of 1