Saturday, September 24, 2011

CSC-352 Compiler Design and Construction Paper 2068

Tribhuvan University
Institute of Science and Technology
2068
Bachelor Level/ Third Year/ Sixth Semester/ Science                          Full Marks: 60
Computer Science and Information Technology                                    Pass Marks: 24
(CSC- 352 – Compiler Design and Construction)                                 Time: 3 hours.
Candidates are required to give their answers in their own words as for as practicable.
The questions are of equal value.
Attempt all questions.                                                                                  (10x6=60)
  1. What do you mean by compiler? How source program analyzed? Explain in brief.

  2. Discuss the role of symbol table in compiler design.

  3. Convert the regular expression ‘0 + (1 + 0)* 00’ first into NFA and then into DFA using Thomson’s and Subset Construction methods.

  4. Consider the following grammar:
  5. S→ ( L )|a
    L→ L, S|S
    (a) Eliminate left recursion.
    (b) Computer FIRST & FOLLOW for the symbol in the grammar.
  6. Consider the grammar
      C→ AB
      A→ a
      B→ b
      Calculate the canonical LR(0) items.

  7. Describe the inherited and synthesized attributes of grammar using an example.

  8. Write the type expressions for the following types.
    (a) An array of pointers to real’s, where the array index range from 1 to 100.
    (b) Function whose domains are function from two characters and whose range is a pointer of integer.
  9. What do you mean by intermediate code? Explain the role of intermediate code in compiler design.

  10. What is operation of simple code generator? Explain.

  11. Why optimization is often required in the code generated by simple code generator? Explain the unreachable code optimization.

0 comments:

Post a Comment