Visvesvaraya Technological University (VTU) 2008-6th Sem B.E Computer Science and Engineering compiler design - Question Paper
sixth semester compiler design ques. paper DEC-07/Jan-08
CS664
, urfsV
v>i j iUJrtfr-i
Sixth Semester B.E Degree Examination, Dec. 07 / Jail. 08
Time; 3 hrs. Max. Marks:100
Note : Answer any FIVE full questions.
1 a. Explain the different phases of a compiler with a block diagram. (10 Marks)
b. Construct transition diagram for the following: i) Relational operators ii) Identifiers and keywords iii) Unsigned numbers. (06 Marks)
c. Construct a NFA for regular expression (a/b) abb (04 Marks)
a.
(08 Marks)
b.
(12 Marks)
Define Ambiguity. Show that the following grammar is ambiguous :
E ->E + E / E - E / E * E / (E) / id
Given the grammar: E -> E + T / T ; T T * F / F ; F -> (E) / id.
i) Remove left recursion.
ii) For the resulting grammar, construct LL (1) parsing table.
(10 Marks) (10 Marks) | ||||||||||||||||||||||||||||||||
|
8 Write short notes on:
a. Determine the operating precedence relation table for the grammar : E ->E + E | E - E | E * E | E / E | E t E | (E) | - E | id, assuming
i) T is of highest precedence and right-associative.
ii) * and / are of next highest precedence and left associative and
iii) + and-are of lowest precedence and left - associative.
b. Construct Canonical LR (1) parsing table for the grammar.
E E + T / T ; T - T * F / F ; F ->(E) / id
a. LEX
b. Recursive Descent Parsing.
c. Error recovery in Operator - precedence parsing.
d. DAG representation of Basic blocks. (20 Marks)
Attachment: |
Earning: Approval pending. |