Sixth Semester B.Tech.Degree Examination,December 2012
(2003 Scheme)
03.601:COMPILER DESIGN(RF)
PART-A
Answer all questions
- Explain the differences between compilers and interpreters.
- Explain the use of regular expressions in compilers.
- Define syntax and semantics of a language with suitable examples.
- What is meant by 'backpatching' in code generation?
- Define handle and handle pruning.
- Explain the difference between NFA and DFA.
- Explain the differences between top down and bottom up parsing.
- Explain left recursion elimination with example.
- Explain global optimization.
- Explain major sources of errors.
PART-B
Answer any one question from each Module.Each question carries 20 marks.
Module-I
11.a) Explain the phases of compiler.
b) Explain the algorithm for minimizing the number of states of a given DFA.
12.Construct NFA from the regular expression ab(a|b*a)*ab and convert to minimized DFA.
Module-II
13..Consider the following grammar
E-->E+T/T
T-->T*F|F
F-->(E)|id
Construct the SLR parsing table for this grammar.
OR
14.a) With example explain operator precedence parsing.
b) Explain ambiguous grammar with suitable example.
Module-III
15.a) Explain the various methods for code optimization with example.
b) Write the syntax directed translation for a desk calculator.
OR
16.a) Write a note on translation of Boolean expressions.
b) Write quadruples,triples and indirect triples for the expression
-(a+b)*(c+d)-(a+b+c).
No comments:
Post a Comment