Visvesvaraya Technological University (VTU) 2007-6th Sem B.E Computer Science and Engineering compiler design - Question Paper
sixth semester compiler design ques. paper DEC-06/Jan-07
fjto- 1 CS664
USN
NEW SCHEME
Sixth Semester B.E. Degree Examination, Dec. 06 / Jan. 07
KB Time: 3 hrs.] fMax. Marks :100
Note : Answer any FIVE full questions.
What is compiler? Explain the different phases of compiler by considering the following statement as input.
1 a-)N- '
t," c-
7, - - -,fc:
2 a.
position := initial + rate * 60 (10 Marks)
Briefly explain the need for multipass in compiler. (06 Marks)
Briefly explain a strategy to reduce the number of passes. (04 Marks)
Write a transition diagram to recognize the following set of tokens. Write program segments for start state, any one of the intermediate states and any one final state. BEGIN END ELSE
Identifier (10 Marks)
What is look ahead operator? With examples show how this operator may be used to solve lexical analysis problems. (10 Marks)
With a schematic, explain the role of Parser. List and explain various error recovery strategies. (10 Marks)
a.
Define left-recursion. Eliminate left recursion from the following grammar :
E-> E + T/ T T -> T * F / F F (E) / id
Also obtain FIRST and FOLLOW symbols for the above resulting grammar.
(10 Marks)
Construct SLR(l) parsing table for the following grammar E T * E / T
T T + F / F '
F > id (10 Marks)
Compare the relative merits and demerits of LL (I), SLR (1), LALR (1) and canonical LR (1) parsing methods. (10 Marks)
Briefly explain the concept of syntax directed definition with example. (06 Marks) Write a note on L-attributed definition. (04 Marks)
a.
b. c.
Give SDTS for an arithmetic expression with +, * and Show annotated parse tree for the input 3+4*5. (10 Marks)
6 a. Explain in detail, different storage allocation strategies. (io Marksj_
b. With example explain different parameter passing methods. (10 Marks''
7 a. Briefly explain the main issues in code generation. (io Marksj b. Briefly explain any five kinds of code-optimization. (10 MarksV
8 Write short notes on :
a. LEX
b. Recursive descent parser.
c. Dead code elimination.
d. L-attributed SDD. (20 Marks)
Attachment: |
Earning: Approval pending. |