Home > Computer Science and Engineering > Complier Design

CS3501 Compiler Design Previous Year Question Papers - Anna University

Explore the Previous Year Anna University Question Papers of CS3501 Compiler Design.

2024

  • 2024 - CSE-AM-2024-CS 3501-Compiler Design-628739042-50906.pdf
  • 2024 - CSE-ND-2024-CS 3501-Compiler Design-311081299-20250604161745 (28).pdf

2023

  • 2023 - CSE-ND-2023-CS 3501-Compiler Design-98033732-20873.pdf

Important Questions - CS3501 Compiler Design

UNIT 1: Introduction to Compilers & Lexical Analysis

Part A (2 Marks)

  • Define Lexeme, Token, and Pattern.
  • What are the two parts of compilation? (Analysis and Synthesis).
  • State the role of Input Buffering and the use of the sentinel character.
  • Differentiate between NFA and DFA.
  • What is a Cross-compiler?.

Part B (13/16 Marks)

  • Explain the Phases of a Compiler with a neat diagram and trace the statement a = b + c * 60.
  • Describe the Role of the Lexical Analyzer and its interaction with the parser.
  • Explain the algorithm for Minimizing DFA with an example.
  • Explain the construction of NFA from a Regular Expression using Thompson's construction.

UNIT 2: Syntax Analysis

Part A (2 Marks)

  • Define Left Factoring and Left Recursion.
  • What is Handle Pruning?.
  • Differentiate between Top-down and Bottom-up parsing.
  • What are the conflicts in Shift-Reduce parsing?.

Part B (13/16 Marks)

  • Construct an LL(1) Parsing Table for a given grammar and check string validity.
  • Explain LR Parsing and construct an SLR Parsing Table for a grammar.
  • Discuss the Error Recovery Strategies in parsing.
  • Write a short note on YACC tool and its structure.

UNIT 3: Intermediate Code Generation

Part A (2 Marks)

  • Differentiate between Synthesized and Inherited attributes.
  • What are Three-Address Codes? Mention its types (Quadruples, Triples, Indirect Triples).
  • Define Backpatching.
  • What is an Annotated Parse Tree?.

Part B (13/16 Marks)

  • Explain Syntax Directed Definition (SDD) and types of attributes in detail.
  • Discuss the Specification of a Simple Type Checker.
  • Explain how Boolean Expressions and Control Flow Statements are translated using backpatching.

UNIT 4: Run-Time Environment & Code Generation

Part A (2 Marks)

  • What is an Activation Record? List its components.
  • Define Heap Management.
  • List the issues in the design of a Code Generator.
  • What is Name Binding?.

Part B (13/16 Marks)

  • Discuss different Storage Allocation Strategies (Static, Stack, and Heap).
  • Explain the algorithm for identifying Basic Blocks and Flow Graphs.
  • Describe the design of a Simple Code Generator.

UNIT 5: Code Optimization

Part A (2 Marks)

  • What is Peephole Optimization?.
  • Define DAG (Directed Acyclic Graph) and its uses.
  • What is Dead Code Elimination?.
  • State the principal sources of optimization.

Part B (13/16 Marks)

  • Explain the Principal Sources of Optimization with examples (Loop, Data Flow, etc.).
  • Discuss the algorithm for DAG Construction for a basic block.
  • Explain Global Data Flow Analysis and Efficient Data Flow Algorithms.

Most Repeated / High-Weight Questions

Compiler phases with tracing, DFA minimization and NFA conversion, LL(1) and SLR parsing tables, code generation and optimization techniques, data flow analysis.

Additional Resources

View Syllabus View Notes

How to Use These Question Papers