Retrieving academic index assets...
Makaut
HomePYQsTests
Pricing
Sign Up
Makaut

The premier academic archive for MAKAUT students, providing curated previous year questions, solutions, and official syllabus resources.

Get the Mobile App
GET IT ONGoogle Play
Download on theApp Store
Download from Indus App Store
Platform
  • Home
  • PYQs
  • Question Papers
  • Viva Questions
  • Important Questions
  • Syllabus
  • Academic Tools
  • Pricing
  • Blog
Guidelines
  • Disclaimer
  • Community Guidelines
Company
  • About
  • Contact
  • FAQ
Legal
  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Cookie Policy
  • Subscription Policy
© 2026 MAKAUT Study Dev Hub. All rights reserved.
Platform version: v1.0.0
Home/PYQs/Sem 5/Compiler Design/2025
PCC-CS501Sem 5 • 2025 Exam
Full Marks: 70 • Time: 3 Hours

MAKAUT Compiler Design 2025 Question Paper

Official theoretical question paper for Compiler Design (PCC-CS501) conducted by Maulana Abul Kalam Azad University of Technology. All questions from Groups A, B, and C are reproduced below with marks weightings.

Download MAKAUT Compiler Design 2025 Question Paper PDFView All PCC-CS501 Papers

AGroup A — Objective / Multiple Choice Questions

10 × 1 = 10 Marks
1(i)[1 Mark]

What is postfix SDT?

1(ii)[1 Mark]

What is equivalence of type expression?

1(iii)[1 Mark]

The actual parameters are not used by the calling procedure. (true/false)

a) true
b) false
1(iv)[1 Mark]

'goto L' is an unconditional jump(to L) three address Instruction.(true/false)

a) true
b) false
1(v)[1 Mark]

A basic block is a sequence of consecutive statements with single entry/single exit. (true/false)

a) true
b) false
1(vi)[1 Mark]

Flex is a lexical analyzer generator tool. (True/False)

a) True
b) False
1(vii)[1 Mark]

Write the name of translator that translates assembly code to relocatable machine code.

1(viii)[1 Mark]

12_Name is a lexeme of pattern identifier in C language. (True/false)

a) true
b) false
1(ix)[1 Mark]

Write the rule for converting left recursive grammar to right recursive grammar.

1(x)[1 Mark]

What is Annotated -parse tree?

1(xi)[1 Mark]

Reduce/Reduce conflict happens during bottom up parsing. (True/False)

a) true
b) false
1(xii)[1 Mark]

How lexical analyzer recognize a token?

BGroup B — Short Answer Conceptual Questions

3 × 5 = 15 Marks
2[5 Marks]

Write the difference between synthesized and inherited attributes with examples.

3[5 Marks]

Describe the purpose of two pointers of Buffer Pairs in Lexical Analyzer.

4[5 Marks]

Convert the DAG into Three address code.

5[5 Marks]

Consider the postfix SDT: Here expr, expr1 both are same, and for differentiate between left expr and right expr, we use expr1 in right. expr → expr1 + term { print('+') } expr → expr1 - term { print('-') } expr → term term → 0 { print('0') } term → 1 { print('1') } ................. term → 9 { print('9') } Draw the parse tree with action embedded for the expression 9 + 4 - 3.

6[5 Marks]

Convert the C code into three address Instruction. while( A[i] >= v ) { i = i + 1; } where array elements are integers of 4 bytes in sized.

CGroup C — Long Answer Analytical & Numerical Questions

3 × 15 = 45 Marks
7(a)[3 Marks]

Suppose ε-closure(q) is a set of states which are reachable from q with zero or more ε-moves, where q is a state in NFA. You are given a Regular Expression R = (b|a)*baa and the set of input symbols is {a,b}U{ε}. Convert this Regular Expression R to NFA N.

7(b)[7 Marks]

Convert this NFA N to DFA D using the definition of ε-closure(q).

7(c)[5 Marks]

Convert this DFA D to Minimal DFA.

8(a)[5 Marks]

Suppose you have given a grammar of certain kind of statements and first & follow sets: A→B A'; A'→+ B A' | ε; B→C B'; B'→* C B' | ε; C→(A) | id | Non-terminals | First sets | Follow sets | |---|---|---| | A | (, id | ), # | | A' | +, ε | +, ), # | | B | (, id | +, ), # | | B' | *, ε | +, *, ), # | | C | (, id | +, *, ), # | Where # is an end marker representing the end of input string. Build the predicting parsing table for the above grammar.

8(b)[5 Marks]

Consider a new set for error recovery of predicting parsing, called synchronizing set of non-terminal A, is a set where each symbol of synchronizing set of non-terminal A is taken from follow(A) set. i.e. synchronizing(C) = follow(C) = {+, *, #}. Instead of wrt 'error' in M[A, a] in parsing table, you use 'syn' in that cell if a belongs to follow(A). Example: If M[A, ] = 'error' in table M, then you use 'syn' in M[A, ] cell of M, since ')' belongs to follow(A). The solution of (b) can be obtained from the following rules given below: (i) If the parser looks up entry M[A, a] and finds that 'error', then the input symbol a is skipped. (ii) If the entry is 'sync', then it skip symbols from input until a terminal symbol is seen which belongs to first(A) to continue parsing, if A is the top of the STACK. (iii) If a token on top of the STACK does not match the input symbol, then you pop the token and resume parsing. Build an error correcting non-recursive version of predicting parsing table for the above grammar.

8(c)[5 Marks]

From the solution of (b), show the behavior of your parser on the following input: | Sl no | STACK | INPUT | Behavior/Action | |---|---|---|---| | 1. | #A | )id * + id# | ........... | | 2. | ####### | | ........... |

9[15 Marks]

Consider the grammar with productions: S → A a | b A c | d c | b d a; A → d Prove that the above grammar is CLR(1) but not SLR(1) by building the parsing table.

10(a)[10 Marks]

Suppose you have been given the three address code of Quick Sort Algorithm | Three address code for Quick Sort | |---|---| | 1: t = m-1 | 11: t5 := a[t4] | 21: a[t10]:= x | | 2: i := n | 12: if t5 > v goto (9) | 22: goto (5) | | 3: i1 := 4*n | 13: if i >= v goto (23) | 23: t11 := 4* i | | 4: v := a[t1] | 14: t6 := 4*i | 24: x := a[t11] | | 5: i := i+1 | 15: x := a[t6] | 25: t12 := 4*i | | 6: i2 := 4*i | 16: t7 := 4*i | 26: t13 := 4*n | | 7: t3 := a[t2] | 17: t8 := 4*j | 27: t14 := a[t13] | | 8: if t3 < v goto (5) | 18: t9 := a[t8] | 28: a[t12] := t14 | | 9: j := j-1 | 19: a[t7] := t9 | 29: t15 := 4*n | | 10: i4 := 4*i | 20: t10 := 4*i | 30: a[t15]:= x | Find the leader codes and basic blocks including three address code of the above code.

10(b)[5 Marks]

Build the flow graph for above code.

11(a)[5 Marks]

Describe in brief about the cousin of Compiler.

11(b)[10 Marks]

Describe the operation of different phases of Compiler with suitable example.

← 2024 Question Paper2026 Question Paper →