B.TechSemester 52023-24Compiler DesignKCS502

Compiler Design (KCS502) - AKTU Question Paper 2023-24

B.Tech · Semester 5 · Free PDF Download

This is the official AKTU Compiler Design Previous Year Question Paper for B.Tech Semester 5, academic session 2023-24. Published by Dr. A.P.J. Abdul Kalam Technical University (AKTU/UPTU), Lucknow. Free PDF download — no login required.

Course:B.Tech
Semester:Semester 5
Session:2023-24
University:AKTU / UPTU

Rate this paper

Questions Asked in 2023-24

Compiler Design (KCS502) — complete question paper · 100 marks · 3 Hours

Section AAttempt all q u e s t i o n s i n b r i e f . 2 x 10 = 20
  • a
    Define bootstrapping in the context of compilers. 2 1
  • b
    Which phase of compiler is optional and why? 2 1
  • c
    Explain the concept of shi ft-reduce parsing. 2 2
  • d
    Differentiate Parse tree and S yntax tree with an example. 2 2
  • e
    Define syntax-directed translation schemes. 2 3
  • f
    What are the two types of attributes that are associated with a grammar symbol?
  • g
    Discuss how scope information is represented in a symbol table. 2 4
  • h
    What is mean by Activation record? 2 4 i. Discuss two design issues in code generation. 2 5 j. Explain the concept of globa l data-flow analysis. 2 5
Section BAttempt any three o f t h e f o l l o w i n g : 10x3=30
  • a
    Describe the relationship between finite state machines and regular expressions. Discuss how regular expressions are used in lexical analysis and pattern matching
  • b
    For the grammar SaAd |bBd |aBe |bAe , Af , Bf Construct LR(1) Parsing table. Also draw the LALR table
  • c
    Explain the concepts of quadruples and triples in the contex t of syntax- directed translation. Discuss how they represent intermediate c ode and support optimization
  • d
    Describe a simple stack allocation scheme for managing memor y during program execution. Explain how it is used for storing local var iables and managing function calls
  • e
    Explain the role of a code generator in a compiler. Discuss its responsibilities and ho w it translates intermediate code into t he target code
Section CAttempt any one p a r t o f t h e f o l l o w i n g : 10x1=10
  • a
    Given a regular expression a (b|c)*, construct the correspond ing Nondeterministic Finite Automaton (NFA) that recognizes the lan guage described by the regular expression
  • b
    Check whether given grammar is ambiguous or not. If ambiguous then convert it into unambiguous grammar: E→E+E|E*E|id
  • a
    Check whether the given grammar is LR(0) or not: S→PQy, P→Sy|x, Q→yS. 10 2
  • b
    Consider the following grammar for a simple expression language: Consider expression id * (id+id).Apply shift reduce parsing to construct parse tree
  • a
    Write syntax directed definition for a given assignment stat ement
  • b
    Explain how syntax-directed t ranslation handles array refere nces within arithmetic expressions
  • a
    Define Symbol table? Explain about the data structures used for symbol table
  • b
    Define semantic errors in a co mpiler. Discuss the challenges associated with detecting and handling semantic errors. Provide examples t o illustrate semantic issues
  • a
    Consider a basic block with t he following three instructions
  • 3
    z = y – d Appl y common sub expression elimination to optimize the basic block
  • b
    Construct a Directed Acyclic Graph (DAG) to represent the fo llowing basic block

Question text is extracted from the official AKTU question paper PDF above. Hindi translations are omitted — every question is printed in English in the original paper. Last verified: 2026-08-23.

Repeated Questions — KCS502

Questions that appeared in more than one session, found by comparing 3 years of Compiler Design papers (2021-22, 2022-23, 2023-24)

2x

Differentiate Parse tree and S yntax tree with an example. 2 2

Appeared in: 2022-23 · 2023-24

2x

What are the two types of attributes that are associated with a grammar symbol?

Appeared in: 2021-22 · 2023-24

2x

Write syntax directed definition for a given assignment stat ement

Appeared in: 2021-22 · 2023-24

2x

Define Symbol table? Explain about the data structures used for symbol table

Appeared in: 2022-23 · 2023-24