Csit Notes

Compiler Design and Construction (CSC376) 2081 BS Past Questions & Solutions

Tribhuvan University (TU) 2081 BS board exam question paper with verified step-by-step solutions for BSc CSIT Sixth Semester.

  • CSC376
  • Core Course
  • 3 Exam Years

Tribhuvan University

Institute of Science and Technology

2081 B.S.

Bachelor Level:
B.Sc. CSIT
Semester:
Sixth Semester
Subject:
Compiler Design and Construction (CSC376)
Full Marks:
60 / 80
Pass Marks:
24 / 32

Candidates are required to give their answers in their own words as far as practicable.

Group A

Long Answer Questions

Attempt any Two questions.

  1. Question 1
    Discuss about Directed Acyclic Graph with an example. Represent the expression $A=(B+C)-(D-E*F)$ using 3AC, Quadruple and Triples.
  2. Question 2
    Create the $LR(1)$ parsing table for following grammar. $S \rightarrow AA$ $A \rightarrow 0A$ $A \rightarrow 1$
  3. Question 3
    Explain the optimization techniques for code optimization. Convert the following program to basic block and control flow. ``` M = A + B N = C + D IF (M > N) { X = M - N } ELSE { X = M + N } E = M + N + X ```

Group B

Short Answer Questions

Attempt any Eight questions.

  1. Question 4
    Compute the FIRST and FOLLOW of all the non-terminals in following grammar. $S \rightarrow AB$ $A \rightarrow 0A' | 1A' | \epsilon$ $A' \rightarrow SSA' | \epsilon$ $B \rightarrow AS | 1$
  2. Question 5
    What are the operations performed in symbol table? Discuss about activation tree.
  3. Question 6
    What are the roles of macros and preprocessor? Discuss about one pass and multi pass compiler.
  4. Question 7
    Define explicit and implicit type conversion. Why do we need to check type of the system? Justify with an example.
  5. Question 8
    Differentiate between synthesized and inherited attributes with example.

All Compiler Design and Construction past papers