Friday 29 July 2016

CD Assignments -I Questions


  SET-I

1. What are the various phases of the compilers? Explain each phase in details. Write down the output of  the each phase for expression a:=b+c*50.

2.  a) Explain the Role of Lexical Analyzer.
     b) Give the regular expression to recognise
        i) Identifies that start with Alphabet
        ii) Float  number in Exponent form
     c) Differencing with Compilers and Interpreters.
3.   (a)  Consider the Grammars
        bexpr--> bexpr or bterm | bterm
        bterm --> bterm and bterm | bfactor
        bfactor --> not bfcator | (bfactor ) | true | false
      Construct the predictive parser table for the above grammar and parser for the sentence not ( true or false).
b) Why should we use Regular Expression for the to define the lexical syntax for the language?
4.   a) Compute the LR(0) items for the Following Grammar:
         S--> L=R | R
          L-->*R  | id
          R--> L
      b) Mention the conflicts that occur the shift -reduce the parser.


SET-II

1. a) What is Pre-processor? What various function that performed by the Pre-processor?
    b)Give the structure of the compiler and also mention function performed by a compiler?
2.  (a) Give the reasons that separate the lexical analyser from the syntax analyser.
      (b) Write the short notes on the language specifying the language analyser.
      (c) Differentiate between terms: Token, Pattern,Lexemes
3. (a) What are the pre-processing steps required for predictive parsing?
    (b) Remove the Left Recussion for the following Grammar and Construct the predictive parsing           table.
          S-->iEtSS' | a
          S' --> eS | E(it is epsilon)
          E-->b
4. (a) Construct the LR(1) parsing table for the following grammar
        E--> E+T |T
        T-->T*F | F
        F--> (E) | id
    (b) Ho the Bottom-up parser differs from the Top-down parser?



SET-III

1. (a) Explain the various phase of the compilers?
    (b) Write short notes on Cross-Compilers?
2. (a) What is Regular Expression? List the rules that define the regular Expressions.
    (b) Explain the transition diagrams for Reserved words and identifiers?
3. (a) Construct the LL(1) parsing table for the following Grammar:
      E-->E+T | T
      T--> T*F | F
       F--> (E)  | id
   (b) Explain the model of non-recursive predictive parser?
4. (a) Consider the Ambiguous grammar and construct the sets of LR(0) items?
       S-->As | b
       A-->SA | a
    (b) Explain the various actions performed by shiftreduce parser with examples?

SET-1V


1.(a) Explain the Functionality of the compilers,assember, interpreter, linker and loader.
   (b) Compare and construct pass with phase with example>
2. (a) Explain the Regular definitions for tje language.
    (b) What are lexical error? explain the error-recovery action in the lexical errors.
3. (a) Discuss about general stragies for the parser can employ fromt he syntatic error.
   (b) Find the FIRST() and FOLOW() fot the grammar and also construct LL(1) parsing table:
       S--> L=R | R
          L-->*R  | id
          R--> L
4. (a). Compute  LR(0) items for the folowing grammar:
     S-->AB
      A-->a | E(it is epsilon)
     B-->b | E( it is epsilon)

 (b) Differeciate between LL parser and LL parser.


No comments:

Post a Comment