COMPILER DESIGN 

1 a) Define Boot strapping.    [3M]  b) What are the draw backs of predictive parsing?  [4M]

  1. What are the actions performed by Shift reduce parser? [4M]
  2. What are Abstract Syntax trees? [4M]
  3. What are the advantages of heap storage allocation?             [4M]
  4. What is machine independent code optimization?             [3M]
Click here to join us on Social Media for getting instant update on every notice

2          a)         Discuss in brief about left Recursion and Left Factoring with examples.            [8M]    b)         Define Regular Expression? Write about the identity rules for regular     [8M] expressions.

             3 a) Construct a Predictive parsing table for the Grammar  [8M]

                                    EàE+T/T, TàT*F/F, Fà(E)/id .

  1. b)      Define Ambiguous grammar? Explain it with an Example.      [8M]

 

 

 

 


 

 

                                    EàE+T/T,   TàT*F/F, Fà(E)/id.

 

                              AàbC/cd,    Càcd, Bàc/d,   is Ambiguous or not?

 

  1. b)         Explain in brief about Type checking and Type Conversion.        [8M]

 

 

 


 

 

PART -B

S -> (L) | a

L ->L,S | S

  1. c) Give the classification of parsing techniques and briefly explain each.                                                           [5M]

T -> int | float

L -> L,id | id

  1. Write the steps for the efficient construction of LALR parsing table. Explain [8M] with an example.

 

 


 

  1. c) What are the limitations of recursive descent parser?                   [5M]

 

               -(a*b) + (c+d)-(a+b+c+d)

  1. Write an algorithm for constructing the dependency graph for a given parse [8M] tree.

for (i=1 to n)

{     j=1;     while (j<=n)

    {

        A=B*C/D;

         j=j+1;

     }

}

 

  1. Explain how an activation record is related with runtime storage organization. [8M]

 

a) Explain in detail about the instruction scheduling with an example. [8M]    b) What are the principle sources of optimization? Give the classification of code

 


 


 

void swap(int i, int j)

{ int t; t=i; i=j; j=t; }

S ->  AaAb | BbBb

  1. c) Discuss how Brute-Force approach operates in top down parsing.                                                        [5M]

S -> Aa| bAc| Bc| bBa

  1. c) Compare bottom up approaches of parsing with all top down approaches.                                           [5M]

(a*b) + (c-d) * (a*b) + b.

  1. Write Syntax directed definition for constructing syntax tree of an expression [8M] derived from the grammar

E -> E + T | E – T | T

T -> (E) | id | num