Compiler Design 2026 — MAKAUT · PCC-CS-501 · Mid Sem PYQ with solutions

  • Solved
  • Verified

Maulana Abul Kalam Azad University of Technology

Solutions

27 answers across 3 groups

Try each question first, then open it to check your answer.

Group AVery Short Answer Type Question · answer any 10 · 1 mark each

  1. I

    Three address code is a linearized representation of DAG. (True/False)

    Free sample

    Answer: True

    Explanation

    Three-address code is often generated by traversing a Directed Acyclic Graph (DAG) or syntax tree and linearizing it into sequential instructions.

  2. II

    What is Source-To-Source Translator?

  3. III

    General register allocation problem is NP-Complete. (True/False)

  4. IV

    JVM is an Interpreter. (True/False)

  5. V

    What is the number of tokens in the C statement printf("%d,%d",a,b); ?

  6. VI

    What types of grammar is used in parsing?

  7. VII

    LEX tool is used for parsing. (True/False)

  8. VIII

    In C language type conversion can be done statically. (True/False)

  9. IX

    Stack is used for storing local data objects. (True/False)

  10. X

    Which type of derivation is used in bottom up parsing?

  11. XI

    In peephole optimization the code in peephole must be contiguous. (True/False)

  12. XII

    Number of states in SLR (1) > Number of states in CLR (1). (True/False)

Group BShort Answer Type Question · answer any 3 · 5 marks each

  1. 2

    Write the differentiate between Compiler and Interpreter.

  2. 3

    Write the structure of Lex program.

  3. 4

    Why the grammar must be augmented during bottom up parsing?

  4. 5

    What is S-attributed and L-attributed SDD?

  5. 6

    Consider the grammar: T →\rightarrow F T' ; T' →\rightarrow union F T' | ϵ\epsilon ; F →\rightarrow not T | id ; Define FIRST and FOLLOW sets for the above grammar. (Assume union and not are operators)

Group CLong Answer Type Question · answer any 3 · 15 marks each

  1. 7(a)

    Describe all phases of 2-pass Compiler.

    12 marks
  2. 7(b)

    What is the purpose of Symbol Table in compiler?

    3 marks
  3. 8

    Write short notes on:

    • (i)
      Local Common sub-expression
    • (ii)
      Dead Code and Unreachable code
    • (iii)
      Reordering of three address instructions
    • (iv)
      Redundant load and store
    • (v)
      Machine Idioms
    Show answer to question 8
  4. 9(a)

    Why Intermediate Code Generation is important in compiler design?

    3 marks
  5. 9(b)

    Explain different types of Intermediate Code Generation techniques with their advantages and disadvantages.

    12 marks
  6. 10(a)

    Lemma: Every Simple-LR (1) (SLR1) is unambiguous, but there many unambiguous grammars that are not SLR (1). Consider the grammar with productions A →\rightarrow B = C | C; B →\rightarrow *C | id; C →\rightarrow B Find the Kernel and Non-kernel LR (0) items of each state of handle recognizing DFA of SLR (1) parsing.

    7 marks
  7. 10(b)

    Build the SLR (1) parsing table and then check whether the above grammar is SLR(1) or not.

    5 marks
  8. 10(c)

    Check whether the above grammar is ambiguous or not.

    3 marks
  9. 11(a)

    Consider a L-attributed SDD given below:

    ProductionsSemantic Rules
    1E →\rightarrow T E'E.node = E'.syn
    E'.inh = T.node
    2E' →\rightarrow + T E1'E1'.inh = new Node( +, E'.inh, T.node )
    E'.syn = E1'.syn
    3E' →\rightarrow - T E1'E1'.inh = new Node( -, E'.inh, T.node )
    E'.syn = E1'.syn
    4E' →\rightarrow ϵ\epsilonE'.syn = E'.inh
    5T →\rightarrow (E)T.node = E.node
    6T →\rightarrow idT.node = new Leaf(id, id.entry)
    7T →\rightarrow numT.node = new Leaf(num, num.val )

    Where, syn and node are synthesized attributes and inh is an inherited attributes. Here E, E1 both are same, and for differentiate between left E and right E, we use E1 in right. Draw the parse tree for the input a - 4 + c.

    Show answer to question 11(a)3 marks
  10. 11(b)

    Build the dependency DAG for evaluation order of attributes of input a - 4 + c and then draw the Syntax tree for the expression over this DAG.

    12 marks

About this paper

The MAKAUT Compiler Design (PCC-CS-501) 2026 Mid Sem previous year question paper, set in semester 5. Download the verified PDF or read it online, then check your answers against the worked solutions above.

Common paper for 2 branches

Every branch listed gets the same questions. Pick a branch to see its other papers.

Why solve Compiler Design PYQs?

Frequently asked questions

5 questions

What is the subject code for Compiler Design?

PCC-CS-501 is the MAKAUT subject code for Compiler Design.

Which exam is this Compiler Design question paper from?

The MAKAUT 2026 Mid Sem exam, semester 5. A student shared it, and it was checked before publishing.

Which branches is this Compiler Design paper for?

It's a common paper for 2 B.Tech branches: Computer Science and Engineering and Information Technology. Every branch gets the same questions.

Where can I find more PCC-CS-501 question papers?

On the Compiler Design subject page, which collects every year's papers along with notes and the syllabus.

Are there solutions for this paper?

Yes. Every question has a worked answer on this page, grouped like the paper. The first answer is free to read; sign in (it's free) to unlock the rest.

Have notes or the answer key for Compiler Design?

Share it and help the next batch of students.