Principles Compiler Design Dec 2002

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Principles Compiler Design Dec 2002 as PDF for free.

More details

  • Words: 325
  • Pages: 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 A O O P 2 ( Q 8 )

i

(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.

602-1,400

20

Related Documents

Compiler Design
June 2020 13
Compiler Design
June 2020 9
Compiler Design
August 2019 43
Compiler Design
November 2019 20