2010 Rajasthan Technical University B.Tech 7 Semester Computer science & engineering "Compiler Construction" question paper

Question Paper Details:

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

      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]
     a)      Explain the concept of input buffering in details. [Marks 8]
     b)      What is the LEX? Explain. [Marks 8]
      a)      Consider the following LL(1) grammar describing a certain sort of rested lists:
      S->T; S|E
     T->U.T |U
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]
      a)      Explain various error recovery strategies in TOP DOWN parsing. [Marks 8]
      b)     Show that following grammar:
    A->d. B->d
   (S,A,B are nonterminal. a, b,c,d are terminal) is LR(1) but not LALR(1). [Marks 8]
      c)       Frame the transition table and Action/ Goto table for the grammar E->E+E|E*E|(E)|id. [Marks 8]
      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]
Generate the three address code for the following c program:
Int i=1;
Int a[10];
}                              [Marks 16]
      a)      Explain procedure call with an example. [Marks 8[
      b)     Explain various approaches to symbol table organization. [Marks 8]

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]
     a)      Construct the DAG for the following basic block:
    A:=E-D                  [Marks 8]
    b)      Discuss various popular code improvement technique. [Marks 8]
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