Addis Ababa University
Addis Ababa Institute of Technology - AAiT
School of Information Technology and Engineering - SiTE
Semester II, 2025
Compiler Design
Instructor: Dr. Henock Mulugeta
COURSE OBJECTIVES:
Upon completion of this course, students will have gained knowledge of compiler design and
construction concepts and to:
Introduce the major concept areas of language translation and compiler design.
Understand the phases of the compilation process and be able to describe the purpose
and implementation approach of each phase.
Know how to use compiler construction tools, such as generators of scanners and
parsers
Be able to define LL(1), LR(1), and SLR(1) grammars with parsing techniques
Be familiar with compiler analysis and optimization techniques
Design a compiler for a simple programming language; and Implement a compiler based
on its design…
Text book
Compilers: Principles, techniques and tools by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman
Reference book
Compiler construction : Principles and practice; Kenneth C.Louden
Course outline
1. Introduction - Canonical LR parsing
Analysis and synthesis in a Yacc parser generator
compilation
Various phases in a compilation 4. Syntax directed translation
Grouping of phases Syntax directed definitions
Major data and structures in a Dependency graph and
compiler evaluation order
Compiler construction tools S-attributed definitions
- Bottom-up evaluation
2. Lexical analysis and Lex - Top-down evaluation
Token, pattern, lexeme L-attributed definitions
Attributes of a token Translation schemes
Errors
Specification of tokens using 5. Type checking
regular expressions Type systems
Regular expression for Specifications of a type checker
programming language tokens A simple language example
Recognizing tokens using Equivalence of types
transition diagrams Type conversion
Design of lexical analyzer
Construction and simulation of 6. Intermediate code generation
NFA and DFA Intermediate languages
Conversion from RE – NFA – Types of three address statements
DFA Syntax directed translation into
Lex scanner generator three address code
Implementation of three address
3. Syntax analysis and Yacc statements
Role of a parser Translation scheme to generate
Context Free Grammar three address code
Derivation, parse tree, ambiguity, Addressing array elements
left recursion, left factoring 7. Code generation and
Syntax analysis Optimization
Syntax error handling Issues in the design of a code
Top down parsing generator
- Recursive decent parsing A simple code generation
- Non recursive predictive algorithm
parsing Memory management
- Construction of predictive Instruction selection
parsing table Register allocation
- LL(1) grammars
Optimization techniques
- Error recovery in predictive
parsing
Bottom up parsing Evaluation method:
- LR(k) parsing - Quiz
- Shift reduce parsing - Assignment and projects
- Construction of SLR parsing - Mid
table - Final