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/2023
PCC-CS501Sem 5 • 2023 Exam
Full Marks: 70 • Time: 3 Hours

MAKAUT Compiler Design 2023 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 2023 Question Paper PDFView All PCC-CS501 Papers

AGroup A — Objective / Multiple Choice Questions

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

If all the operators are binary, then a string of operands and operators is a postfix expression if and only if ________

1(ii)[1 Mark]

Given a grammar G=(V, T, P, S) and every production in P is of the form A->α where A is in V and α is in (V U T)*, then G is ________

1(iii)[1 Mark]

A compiler running on computers with a small memory would normally be ________

1(iv)[1 Mark]

Input to LEX is ________

1(v)[1 Mark]

A basic block is ________

1(vi)[1 Mark]

Given a finite automaton M=(Q,Σ, δ, q0, F). If δ maps Q × Σ to 2 Q, then ________

1(vii)[1 Mark]

Given a string abc, the string acc is a ________

1(viii)[1 Mark]

A garbage is ________

1(ix)[1 Mark]

How many descriptors are used for track both the registers (for availability) and addresses (location of values) while generating the code?

1(x)[1 Mark]

A synthesized attribute is an attribute whose value at a parse tree node is defined in terms of ________

1(xi)[1 Mark]

Elimination of loop invariant computation is a peephole optimization. True/False?

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

________ is a loop optimization

BGroup B — Short Answer Conceptual Questions

3 × 5 = 15 Marks
2[5 Marks]

Describe input buffering in lexical analyser.

3[5 Marks]

Explain the model of a non recursive predictive parser with a diagram.

4[5 Marks]

Find the output, given grammar G1 and associated semantic rules and input: aadbdb • S->AS [print(1)] • S->AB [print(2)] • A->a [print(3)] • B->b C [print(4)] • B->d B [print(5)] • C->c [print(6)]

5[5 Marks]

What is ambiguity? Show that G2:{S->aS|Sa|a} is ambiguous

6[5 Marks]

What is code optimization? Optimize the following C-code: count=0; result=0; while(count++ < 20) { increment= 2*count; result +=increment; }

CGroup C — Long Answer Analytical & Numerical Questions

3 × 15 = 45 Marks
7[15 Marks]

For the following grammar E-> E or T|T T->T and F|F F-> not F|(E)|0|1 a) Eliminate left recursion from the above grammar b) Find FIRST(X),Follow(X) for each variable in the grammar c) Construct a predictive parser table for the grammar d) Is the above grammar LL(1). Justify your answer

8[15 Marks]

a) What is a compiler? b) Explain the different phases of compiler with an example c) Compare and contrast between a compiler and an interpreter

9[15 Marks]

i) Express the expression y=(a+b)*c in a.) postfix notation b.) Abstract syntax tree c.) Three address code ii) Implement the TAC using a. quadruples b. triples c. indirect triples

10[15 Marks]

Consider the regular expression (a+b)*(a+b)(a-b) I. Augment the expression and construct the syntax tree for the above regular expression II. Find Firstpos() and Lastpos() for every internal node in the syntax tree III. Find Followpos() for every position in the syntax tree IV. Construct the corresponding DFA for the given RE using Followpos()

11[15 Marks]

11. a) What is LEX? b) Explain the working of LEX c) Show the step by step construction of a lexical analyzer with the following three tokens • a • abb • a*b+

2024 Question Paper →