Wednesday 28 June 2017





III-I SEM IT -SVECW


COMPILER DESIGN 


ASSIGNMENT-I  QUESTIONS

SET-I
1. a) Differentiate between compiler and interpreter.
   b) What is compiler? Explain in brief about phases of a Compiler.
2 a) Write regular expressions for the following patterns. 
   i) The set of words having a, e, i, o, u appearing in that order, although not   necessarily consecutively.  
  ii) All the strings of a's and b's that do not contain the substring abb.
  b) Explain the  lexical analyzer in compiler construction process.
3.  a) What are compiler & interpreter? Write short notes on  compiler and
         an interpreter.
   b) Explain various phases in the construction of a compiler.
4. a)   Explain the role of lexical analyzer.
   b) What are the reasons for separating lexical analysis from syntax analysis?

                            SET-II
1. a ) What is regular expression? Write the regular expression following.
     i) Accepts all strings of 0’s & 1’s which and with 01.
      ii) Accepts all strings of 0’s & 1’s, whose 9 th position from the right end is 1.
       iii) Equal no of 1’s & 0’s
     b) What is Transition diagram? Explain with examples.
2. a) Describe the need and functionality of linkers, assemblers and loaders.
    b) What is the role of lexical analysis? Give examples.
    c) Differentiate between lexical analysis and parsing.
3.  a) Explain the different phases of the compiler, showing the output of each phase using  the  example for the statement
                      z = ( a*20 ) + b – c
      b)  Construct transition diagram for  the Regular Expression (a/b)*abb(a/b)*.
   c) Write about Lexical errors and their handlers.

                          SET-III

1. a) Describe the output for the various phases of compiler with respect to the following statement
position=initial+rate*60     
      b) Explain the reserved words and identifiers.

2. a) What is a regular expressions? Write a regular expression for identifier keyword and design a transition diagram for it.
       b) Explain the following terms with example
 i) token  ii) pattern  iii) lexeme
3.  a) Explain the structure of a compiler. 
      b) Consider the following fragment of ‘c’ code
                 float i, j;                  i= i*70+j+2;
        Write the output at all phases of a compiler. 

No comments:

Post a Comment