CSC365 Compiler Design and Construction

Compiler Design and Construction TU Board 2078 question paper

12 questionsSit this paper (timed)

Tribhuvan University

Bachelor of Science in Computer Science and Information Technology

Semester 6 · TU Board 2078

Course Title: Compiler Design and Construction (CSC365)

Full Marks: 60Pass Marks: 24Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.

Group A

Attempt all questions.

  1. 1.

    What are the task performed in lexical analysis. Define DFA. Given regular expression:

    (a+b)*a(a+b)

  2. 2.

    Difference between LR(0) and LR(1) algorithm. Construct LR(1) parse table for s->AA ,A->aA/b

  3. 3.

    Type checking is the process of verifying that the types of expressions and variables used in a program are consistent and adhere to languages type system rules. The primary goal of type checking is to identify and prevent type-related errors before the program is executed.

  4. 4.

    Difference between compiler and interpreter.

  5. 5.

    What are the typical entries made in symbol table? Explain.

  6. 6.

    Define Left recursive grammar. Remove left recursion from the following grammar.
    S→SB | Ca
    B→Bb | c
    C→aB | a

  7. 7.

    What are the disadvantages of shift reduce parsin perform shift reduce parsing of string

    w=(x-x)-(x/x) for grammar

    E=E-E/ E/E / (E) / x

  8. 8.

    Define attribute grammar with example of inherited and synthesized attributes

  9. 9.

    Define three address code. Write down Quadruples for a=-b*(c+d)/e

  10. 10.

    List out the different types of runtime storage management techniques.

  11. 11.

    What are the advantages of code optimization. Define Dead-code elimination.

  12. 12.

    Factors affecting (target code generator) code generator/code generator design issues

— The End —