Course Introduction:
At the end of the course, students should understand the overall structure of a compiler, and will have the knowledge of the significant details of a number of important techniques commonly used. The language features raise challenges for compiler builders are also introduced in this course.
Course Objectives:
- To teach students the basic concepts of compilers, their components and how they work together
- To get lexical analyzer and syntax analyzer implemented of any programming language
Teaching-Learning Methodology:
The students will learn through the combination of lectures, readings, presentations, and course project.
Text Books:
- Compiler Construction by Kenneth C. Louden and Glagotia
- Modern Compiler Implementation in C, By Andrew W. Appel, Maia Ginsburg, Contributor Maia Ginsburg, Cambridge University Press, 2004.
- Modern Compiler Design by Dick Grune, Henri E. Bal, Ceriel J. H. Jacobs, Koen G. Langendoen, 2003, John Wiley & Sons.
- https://t4tutorials.com/passes-and-phases-of-compiler-design/
Pre-requisite Courses:
- Automata Theory
- Computer Programming
Major Topics to be Covered | |
Week 1 | Introduction
Overview of Compilers, Compilation Process, Phases of Compiler, Cousins of compiler |
Week 2 | Lexical Analyzer
Overview and Role of Lexical Analyzer, Tokens, Lexemes, Patterns, Specification of tokens, recognition of tokens. |
Week 3 | Lexical Analyzer (Continued)
Finite automata, NFA, DFA, Conversion from a regular expression to an NFA, NFA problems, NFA & DFA Comparison, Design of a Lexical Analyzer. |
Week 4 | Symbol Table Manager
Overview, Symbol Table organization, Classification of the symbol table, symbol table operations, working, implementation. |
Week 5 | Syntax Analyzer
Role of Parser, Context-Free grammars, writing a grammar, Types of Parsing, Top-down parsing, Bottom-up parsing |
Week 6 | Syntax Analyzer (Continued) Backtracking, Recursive Descent parsing, problems with RD parsing, Predictive parsing, Transition diagrams for predictive parsers, Non-Recursive Predictive Parsing |
Week 7 | Syntax Analyzer (Continued)
Practical Examples and Parser Generators. |
Week 8 | Semantic Analysis
Overview of Type Checking, specification of a simple type checker, Equivalence of type expressions |
Midterm Exam | |
Week 9 | Semantic Analysis (Continued)
Type conversions, type rules, type constructors, Overloading of functions and operators, polymorphic functions |
Week 10 | Semantic Analysis (Continued)
A simple type checker generator |
Week 11 | Intermediate Code Generator
Intermediate languages, declarations, Three address code instructions, and their representations |
Week 12 | Intermediate Code Generator (Continued)
Intermediate Code Generator examples |
Week 13 | Code Optimization
Overview, the principal sources of optimization, optimization of basic blocks, loops, code improvement transformations. |
Week 14 | Code Generation
Role of a code generator, Issues in the design of a code generator, Runtime storage management, simple code generator. |
Week 15 | Detection and recovery from errors
Detection of syntax errors by compilers and their recovery mechanism |
Week 16 | Miscellaneous
Overview of principles of programming languages. Criteria for selecting programming languages, Representing concurrency and analyzing concurrent designs |
Final Exam |