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

AKTU · BTECH · Semester 6 · Compiler Design · Session 2023-24 · PYQ

AKTU Compiler Design (KCS502) previous year question paper 2023-24 for B.Tech Semester 6. Covers Compiler Foundations, Lexical Analysis and Syntactic…

Open the interactive reader to study this resource on AcademicArk.

Compiler Design AKTU syllabus

  1. Unit 1: Compiler Foundations, Lexical Analysis and Syntactic Specification
  2. Unit 2: Basic Parsing Techniques and Automatic Construction of Efficient Parsers
  3. Unit 3: Syntax-Directed Translation and Intermediate Code
  4. Unit 4: Symbol Tables, Run-Time Administration and Error Recovery
  5. Unit 5: Code Generation and Code Optimization

Questions in Compiler Design AKTU PYQ 2023-24

  1. Q1a. Define bootstrapping in the context of compilers. (2 marks, 2023-24)
  2. Q1b. Which phase of compiler is optional and why? (2 marks, 2023-24)
  3. Q1c. Explain the concept of shift-reduce parsing. (2 marks, 2023-24)
  4. Q1d. Differentiate Parse tree and Syntax tree with an example. (2 marks, 2023-24)
  5. Q1e. Define syntax-directed translation schemes. (2 marks, 2023-24)
  6. Q1f. What are the two types of attributes that are associated with a grammar symbol? (2 marks, 2023-24)
  7. Q1g. Discuss how scope information is represented in a symbol table. (2 marks, 2023-24)
  8. Q1h. What is mean by Activation record? (2 marks, 2023-24)
  9. Q1i. Discuss two design issues in code generation. (2 marks, 2023-24)
  10. Q1j. Explain the concept of global data-flow analysis. (2 marks, 2023-24)
  11. Q2a. Describe the relationship between finite state machines and regular expressions. Discuss how regular expressions are used in lexical analysis and pattern matching. (10 marks, 2023-24)
  12. Q2b. For the grammar S→aAd |bBd |aBe |bAe, A→f, B→f Construct LR(1) Parsing table. Also draw the LALR table. (10 marks, 2023-24)
  13. Q2c. Explain the concepts of quadruples and triples in the context of syntax-directed translation. Discuss how they represent intermediate code and support optimization. (10 marks, 2023-24)
  14. Q2d. Describe a simple stack allocation scheme for managing memory during program execution. Explain how it is used for storing local variables and managing function calls. (10 marks, 2023-24)
  15. Q2e. Explain the role of a code generator in a compiler. Discuss its responsibilities and how it translates intermediate code into the target code. (10 marks, 2023-24)
  16. Q3a. Given a regular expression a(b|c)*, construct the corresponding Nondeterministic Finite Automaton (NFA) that recognizes the language described by the regular expression. (10 marks, 2023-24)
  17. Q3b. Check whether given grammar is ambiguous or not. If ambiguous then convert it into unambiguous grammar: E→E+E|E*E|id. (10 marks, 2023-24)
  18. Q4a. Check whether the given grammar is LR(0) or not: S→PQy, P→Sy|x, Q→yS. (10 marks, 2023-24)
  19. Q4b. Consider the following grammar for a simple expression language: E → E + T | T T → T * F | F F → ( E ) | id Consider expression id * (id+id).Apply shift reduce parsing to construct parse tree. (10 marks, 2023-24)
  20. Q5a. Write syntax directed definition for a given assignment statement: S → id=E E → E+E E →E*E E→-E E → (E) E→id (10 marks, 2023-24)
  21. Q5b. Explain how syntax-directed translation handles array references within arithmetic expressions. (10 marks, 2023-24)
  22. Q6a. Define Symbol table? Explain about the data structures used for symbol table. (10 marks, 2023-24)
  23. Q6b. Define semantic errors in a compiler. Discuss the challenges associated with detecting and handling semantic errors. Provide examples to illustrate semantic issues. (10 marks, 2023-24)
  24. Q7a. Consider a basic block with the following three instructions: 1. x = a + b 2. y = x * c 3. z = y – d Apply common sub expression elimination to optimize the basic block. (10 marks, 2023-24)
  25. Q7b. Construct a Directed Acyclic Graph (DAG) to represent the following basic block: 1. x = a + b 2. y = c - d 3. z = x * y (10 marks, 2023-24)

AKTU paper codes: BCS602

Compiler Design previous year papers

More Compiler Design resources

Browse all notes · Semester 6 notes · Compiler Design notes