Question Paper Details:
Exam Year: Nov-Dec 2011
Year or Semester: Fourth year/ Seventh Semester
Paper Code: 7E4091
University: Rajasthan Technical University
Course: B.Tech Computer science & engineering
Subject: Compiler Construction
Exam Year: Nov-Dec 2011
Year or Semester: Fourth year/ Seventh Semester
Paper Code: 7E4091
Unit-I
a) Explain all the phases of compiler with the help of suitable example. [Marks 8]
b) What is the basic task of scanning? What are the difficulties found in delimiter oriented scanning? How can this be removed? [Marks 8]
OR
a) Explain the concept of input buffering in details. [Marks 8]
b) What is the LEX? Explain. [Marks 8]
Unit-II
a) Consider the following LL(1) grammar describing a certain sort of rested lists:
S->T; S|E
T->U.T |U
U->x|y|[S]
i) Left factor this grammar. [Marks 2]
ii) Give the First and FOLLOW sets for each non terminal in the grammar obtain in part (i). [Marks 3]
iii) Using this information construct an LL parsing table for the grammar obtained in part (i). [Marks 3]
OR
a) Explain various error recovery strategies in TOP DOWN parsing. [Marks 8]
b) Show that following grammar:
S->Ac|bAc|Bc|bBa
A->d. B->d
(S,A,B are nonterminal. a, b,c,d are terminal) is LR(1) but not LALR(1). [Marks 8]
OR
c) Frame the transition table and Action/ Goto table for the grammar E->E+E|E*E|(E)|id. [Marks 8]
Unit-III
a) Explain L attributed definition. [Marks 8]
b) Give the syntax directed definition below with the synthesized attribute val, draw the annotated parse tree for the expression (3+4)*(5+6):
L->E L.val=E.val
E->T E.val=T.val
E->E1+T E.val=E1.val+T.val
T->F T.val=F.val
T->T1*F T.val=T1.val*F.val
F->(E) F.val=E.val
F->digit F.val=digit. Lean val. [Marks 8]
OR
Generate the three address code for the following c program:
Main()
{
Int i=1;
Int a[10];
While(i<=10)
A[i]=;
} [Marks 16]
Unit-IV
a) Explain procedure call with an example. [Marks 8[
b) Explain various approaches to symbol table organization. [Marks 8]
OR
a) Explain format of an activation record. [Marks 8]
b) If we want to support local arrays of variable size. Then suggest the storage allocation that is suitable to meet the requirement. [marks 8]
Unit-V
a) Construct the DAG for the following basic block:
D:=B*C
E:=A+B
B:=B*C
A:=E-D [Marks 8]
b) Discuss various popular code improvement technique. [Marks 8]
OR
a) Explain basic block and control flow graph. [Marks 8]
b) What is loop in variant computation? Give an example? [Marks 8]
Return to Question Paper