CS25C18 Compiler Design is a theory subject in semester 4 of Anna University R2025 B.E./B.Tech. for Computer Science and Engineering (AI and Machine Learning), Computer Science and Engineering (Cyber Security), Computer Science and Engineering (Data Science), Computer Science and Engineering (Internet of Things). The full unit-wise syllabus is below.
| Subject code | CS25C18 |
|---|---|
| Subject name | Compiler Design |
| Regulation | Anna University R2025 |
| Semester | 4 |
| Branches | Computer Science and Engineering (AI and Machine Learning), Computer Science and Engineering (Cyber Security), Computer Science and Engineering (Data Science), Computer Science and Engineering (Internet of Things) |
| Category | Engineering Sciences / Professional Core |
| Course type | Theory |
| Credits (L-T-P-C) | 3-0-0-3 |
| Semester scheme | AI&ML · CSE (DS) · CSE (IoT) · Cyber Security |
Course Objectives
This course focuses on analyze the intricate process by which high-level programming languages are transformed into low-level machine code and facilitates the synthesis of knowledge regarding diverse compiler construction phases.
Unit I: Basics Of Compiler and Lexical Analysis
Language Processors – Structure of a Compiler – Grouping of phases, Compiler construction tools – Applications of Compiler Technology – Lexical Analysis – Role of Lexical Analyzer – Input Buffering – Specification of Tokens – Recognition of Tokens – Lexical-Analyzer Generator Lex
Suggested Activities:
Identify the errors: Present code snippets with lexical errors. Ask students how a lexical analyzer would typically handle these errors.
Debugging: Encourage them to experiment with different input strings and debug their Lex specifications.
Study CS25C18 Compiler Design on your phone: syllabus, notes and previous year question papers in iStudy.
Scan with your phone camera to install (Android & iPhone)
Unit II: Top-Down Parser
Parser – Role of parser – Context-Free Grammars – Writing a Grammar
- Top-Down Parsing – Recursive-Descent Parsing – FIRST() and FOLLOW() – LL(1) Grammars – Non-recursive Predictive Parsing
Suggested Activities:
Solve the exercises: Encourage the student to find the FIRST() and FOLLOW().
Discussion: Students prepare and present short videos explaining about the top down parser
Unit III: Bottom – Up Parser
Bottom-Up Parsing –Basics of LR Parsing: Simple LR – Canonical LR – Look –Ahead LR – Example Problems of all LR parser.
Suggested Activities:
Poster Presentation: Design posters illustrating the role of parsers using popular tools
Solving Exercises: Give some example problems to construct the parsing tables.
Unit IV: Syntax Directed Translation And Intermediate Code Generation
Syntax Directed Translation – Syntax-Directed Definitions – Evaluation Orders for SDD’s – – Intermediate Code Generation – Variants of syntax trees – Three Address Code – Types and Declarations – Translation of Expressions – Type Checking – Control Flow
Suggested Activities:
Solving exercises: Solve the example problems in implementation of three address code part.
Seminar : All intermediate codes during compilation
Unit V: Code Generation and Storage Management
Issues in the design of a code generation
- The target Language – Addresses in the Target code – A simple code Generator – Run-Time Environments: Storage organization – Stack allocation of space – Heap Management
- Basics of garbage collection.
Suggested Activities:
Seminar: Advanced topics in Garbage Collection.
Quiz: Test understanding of storage allocation strategies.
Unit VI: Machine Independent Optimization
Basic Blocks and Flow Graphs –Optimization of Basic Blocks – Peephole Optimization – The Principal Sources of Optimization – DAG – loops in flow graphs.
Suggested Activities:
Diagram aid: Draw the flow graphs for the optimization of basic blocks concept using any recent tool.
Quiz : Test concepts of basic blocks, flow graphs, and code optimization
Reference Books
- Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, 2nd Edition, Pearson, 2023.
- Keith D. Cooper, Linda Torczon, Engineering a Compiler, 3rd Edition, Morgan Kaufmann, 2022.
- Chattopadhyay S. Compiler Design. 2nd ed. PHI Learning; 2022.
E-Resources
- NPTEL – Compiler Design Instructor: Prof. Santanu Chattopadhyay, IIT Kharagpur Link: https://onlinecourses.nptel.ac.in/noc21_cs07/preview
- Principles of Compiler Design – NPTEL (IISc Bangalore) Instructor: Prof. Y.N. Srikanth, IISc Bangalore www.youtube.com/playlist?list=PLbMVogVj5nJQNjkHZgwuAlfQ9tzmQDxjA
Course Outcomes
- Describe the fundamental concepts, phases, and design principles involved in the construction of compilers for programming languages.
- Analyze lexical, syntax, and semantic analysis techniques to understand the processing and translation of source programs into executable forms. –
- Evaluate parsing methods, code optimization techniques, and runtime environments to assess their efficiency and suitability in compiler construction. –
- Design compiler components by selecting appropriate algorithms and techniques for lexical analysis, parsing, code generation, and optimization. –
Study CS25C18 Compiler Design on your phone: syllabus, notes and previous year question papers in iStudy.
Scan with your phone camera to install (Android & iPhone)