0% found this document useful (0 votes)
649 views3 pages

Principles Compiler Design Dec 2002

This document contains instructions for a compiler design exam with 7 questions. Students are instructed to attempt any 5 questions out of the 7. The questions cover topics like the role of a translator and different compiler phases, lexical analysis, parsing, LL(1) grammars, syntax directed translation, symbol tables, error handling, and code optimization techniques.

Uploaded by

api-3782519
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
649 views3 pages

Principles Compiler Design Dec 2002

This document contains instructions for a compiler design exam with 7 questions. Students are instructed to attempt any 5 questions out of the 7. The questions cover topics like the role of a translator and different compiler phases, lexical analysis, parsing, LL(1) grammars, syntax directed translation, symbol tables, error handling, and code optimization techniques.

Uploaded by

api-3782519
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

60

2
B. E. (Computer Engg.) VIIth Semester Examination,
December-2002

PRINCIPLES OF COMPILER DESIGN


Paper-CSE-403-C
TIme allowed: 3 hours Maximum Marks: 100

Note: Attempt any five questions.


1. (a) What is meant by a translator ? What are the
characteristics of a good translator? 10
(b) What is meant by book-keeping? Which phases of a
compiler perform this job? Justify your answer. 10

2.(a) Explain the role of lexical analyzer in compiler. 10


(b) What is meant by input buffering? How it is useful in
design of lexical analyzer? 10

3. (a) What do you mean by a handle? Explain the stack


implementation of shift-reduce parser with the help of an
example. 10
(b) What do you understand by ambiguous grammar ?
How ambiguity can be removed? Give an example. 10
4. Following is an LL (1) grammar for regular expressions over
alphabet {a, b}, with + standing for union operator (I) and E
for symbol E.
E~TE'
E' ~ + E/ E

T~FT'

6
0
2
-
1 i

A
O
O
-
P
2
-
(
Q
-
8
)
(2)

'T' --* TIE


F--*PF'
F' --* *F' I E
P --* (E) I a I b I E

(a) Compute First and Follow for each nonterminal of


above grammar.
(b) Show that grammar is LL (1).
(c) Construct the predictive parsing table for grammar. (d)
Construct a recursive-descent parser for grammar.
20

5. Explain the syntax directed translation scheme for the desk


calculator which performs +, * operations of simple data
types. Also evaluate the expression 23 * 5 + 4 $. 20
6. What information a good symbol table should contain?
Explain how the information about data is stored and fetched
from symbol table when needed. 20

7. What are the various sources of error? Explain some of the


possible action a good compiler should take after finding
some errors. 20

8. Write short notes on :

(b) Code Motion


(c) Induction variables. 20

602-1,400

You might also like