CC PRELIM SET A



1 “Certain variables might be used before being defined” is an example of
            a) structure unit                                                    b) pretty printers   
c) static checker                                                  d) interpreter
2 Output of loader is
a)      Source program                                             b) reloadable machine code           
c) target assembly program                                 d) absolute machine code
3 €-closure (T) is
            a) set of NFA states reachable from some NFA state s in T on €- transaction alone
            b) set of NFA states reachable from  NFA state on €- transaction alone
            c) set of NFA states  d) None
4 LL(k) grammar  
            a) Has to be CFG                                                        b) has to be unambiguous 
c) cannot have left recursive NT                                d) None of the above
5 Which of the following is not example of top down parser?
            a) RD parser                            b) predictive parser  
c) SR Parser                            d) Non-recursive predictive parser
6 A grammar is said to be operator precedence if it possesses
            a) No production on right side €   b) No production on right side has two adjacent NTs
c) Both a & b                                d)  None of the above
7 The grammar E -> E+E|E*E|a  is  
            a) ambiguous     b) unambiguous         c) no, depends on sentence  d) ND
8 Consider the grammar
S-> Aa|bAc|Bc              A->d|                      B-> d
FIRST (S) is
            a) {a,b, €}            b) {a,b,d}                 c) {a,b,d, €}          d) All of the above
9 _________ syntax of mkleaf  is
            a) mkleaf(id,num)                   b) mkleaf(num,val)         c) mkleaf(id,entry)  d)  Both b & c
10 Value-Number method for constructing node in DAG uses
            a) Index search techniques      b) Sequential search      c) Hash function      d) Both b & c


11 Which of the following is needed to refer to the non-local data held in other activation record?
            a) Control link                                       b) Access link  
c)Temporaries                                        d) Saved machine status
12 In which storage allocation strategy size is required at compile time?
            a) Static allocation                                                      b) dynamic allocation
            c) stack allocation                                                       d) All
13 Which of the following are parameter passing methods
            a) Call by value                                                                       b) call by reference
c)Call by restore                                                                      d) all
14 The cost of instruction depends on
            a) cost associated with speed of execution                   
b) cost associated with instruction length
            c) one plus cost associated with source and destination source address  d) All of these
15 The quality of generated code is determined, depends on which of the following factor?
            a) Uniformity and completeness               b) Speed, size  
c) Machine idioms, uniformity                  d) None of the above
16 Code improvement phase consists of ________ followed by application of transformations
            a) Data-flow analysis  b) control-flow analysis   c) both a & b         d) None
17 A transformation of a program is called _________ if it can be performed by looking only at the statements in basic block.
            a) Local                         b) Global                   c) both a & b   d) None
18 The technique(s) important for loop optimization is/are
            a) code motion                                    b) induction variable elimination
c)reduction in strength                        d) All
19 A method for trying to improve the performance of the target program by examining a short sequence of target instructions and replacing these instructions by ashorter or faster sequence is
a) Peephole optimization              b) code motion       c)reduction in strength  d) All
20 Which of the following are 3-address code representation?
            a) indirect triple                       b) triple                c) quadruple            d) All








2          Attempt any four:                                                                                       (5x4=20 Marks)
a)      Explain shift reduce parsing using stack with the help of suitable example.
b)      List and explain compiler construction tools.
c)      Explain error recovery strategies in parser.
d)     Describe SDT scheme using semantic actions.
e)      Explain recursive descent parsing.
3          Attempt any one:                                                                                                   10 Marks
            a) Discuss the design of the Lexical Analyser Generator
b) Explain in detail Bottom up evaluation of S-attributed definitions.

4          Explain top-down translation of L-attributed definitions.                                    10 Marks
5          Write note on: (any four)                                                                           (5x4=20 Marks)
            a) Explain backpatching.           
            b) Explain the concept of copy propagation with example.
c) Explain dynamic storage allocation.
            d) Note on implicit deallocation.                            
            e) Describe 3 address code for assignment statements..

6          Attempt any one:                                                                                                    10Marks
a) What is 3-address code? Explain the types of three address code.
b) Explain any two code improving transformations.
7         Explain stack and static allocation strategies with example.                                         10Marks

Comments