Skip to content
CS-603 · Compiler Design/Unsolved PYQ Paper

CS-603 Compiler Design - May 2023 Question Paper

  1. 8 Marks
    aDraw the structure of a compiler and describe various phases in the compilation process. Mention the output of the following statement: $id_1=id_2+id_3*50$ at each phase.
  2. 6 Marks
    bDesign the LEX program that recognizes the tokens of a C language and returns the token found.
  3. 14 Marks
    Compute LR(0) items for the following grammar and construct SLR Parser table. $S \rightarrow L=R | R$ $L \rightarrow *R | id$ $R \rightarrow L$
  4. 7 Marks
    aDifferentiate between Top down parsing and Bottom up parsing.
  5. 7 Marks
    bConstruct the Recursive Descent Parser with back tracking for the following grammar $S \rightarrow aSbS | bSaS | \epsilon$
  6. 10 Marks
    aHow is Stack storage allocation strategy different from heap allocation strategy? Describe them and mentioning their merits and demerits.
  7. 4 Marks
    bExplain different Polymorphic functions with suitable examples.
  8. 8 Marks
    aExplain in brief about different sources of optimization of basic blocks with suitable example.
  9. 6 Marks
    bDefine flow graph? Explain how a program is converted into a flow graph.
  10. 8 Marks
    aWhat is DAG? Construct DAG for the following basic blocks: $D := B*C; E := A+B; B := B+C; A := E-D;$
  11. 6 Marks
    bDifferentiate between S-attribute with L-attribute definition with suitable example.
  12. 8 Marks
    aExplain in brief about equivalence of type expression.
  13. 6 Marks
    bDiscuss about peephole optimization.
  14. 14 Marks
    Write a short note on following: a) Common sub-expression elimination b) Register allocation c) Three address code
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in