Tribhuvan University
Institute of Science and Technology
2068
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)
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)
- What do you mean by compiler? How source program analyzed? Explain in brief.
- Discuss the role of symbol table in compiler design.
- Convert the regular expression ‘0 + (1 + 0)* 00’ first into NFA and then into DFA using Thomson’s and Subset Construction methods.
- Consider the following grammar:
- Consider the grammar
-
C→ AB
A→ a
B→ b
Calculate the canonical LR(0) items. - Describe the inherited and synthesized attributes of grammar using an example.
- 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. - What do you mean by intermediate code? Explain the role of intermediate code in compiler design.
- What is operation of simple code generator? Explain.
- Why optimization is often required in the code generated by simple code generator? Explain the unreachable code optimization.
(a) Eliminate left recursion.S→ ( L )|a
L→ L, S|S
(b) Computer FIRST & FOLLOW for the symbol in the grammar.
0 comments:
Post a Comment