2011 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: 7E4239

1.     a) Explain the different phases of compiler design with the help of suitable diagram. [ Marks 8]

     b) Explain the following terms
         i) Translators, compiler and interpreters
         ii) Bootstrapping                                             [Marks 2+2]
    c) Illustrate the translation of the following statement on all phases of compiler
         a:=b*c+d/e          [Marks 4]
      a) Write short note on “Input Buffering”                [Marks 2]
b) Construct minimum state DFA for the following regular expression. [Marks 6]
    b(a/b)* a
    (a/b)* a(a/b) (a/b)
c) What is role of lexical analyzer?            [Marks 2]
d) Define the term NFA and DFA with an example. What are the rules to get a NFA for a regular expression? And also describe the application and limitations of finite automata. [Marks 6]

2. a) Consider the following grammar G:

E-> TE’
E’->+TE’/ €
F->( E ) /id
Where € denotes the empty string of symbols
i)                    Compute FIRST and FOLLOW for each non terminal of the grammar G.
ii)                   Construct a predictive parsing table for grammar G. [Marks 3+3]
b) What do you mean by context free grammar? Give distinction between regular and context free grammar and limitations of context free grammar. [Marks 4]
c) Show whether the following grammar is LL(1) or not
                F->( E ) /id
                And explain the model of a predictive parser.     [Marks 3+3]
2 Explain Top down and Bottom up parsing techniques in detail. [Marks 16]

3.   Write a program to translate an infix expression into postfix form. Also write syntax directed definition for the same. [Marks 16]


3 a) Define syntax directed definition. Explain the various forms of syntax directed definition. [Marks 10]
  b) Write specification of a simple type checker with example. [Marks 6]


       4. a) Write short notes on
i)                    Activation Record
ii)                   Parameter passing          [Marks 6*2]
b) Differentiate between stack and heap allocation. [Marks 4]
4 a) What are various Runtime storage Management techniques? Explain with programming examples. [Marks 10]
  b)  Write short note on symbol table. [Marks 6]

5.  a) Construct the DAG and generate the code for given block. [Marks 8]

                b) Write short not on code optimization and DAG. [Marks 8]
5 Construct the tree for following expression and apply labeling algorithm for optimal ordering x*(y+z)-z/(u-v)                  [Marks 16]

Return to Question Paper