BCT 2311 Compiler Construction Course Outline
BCT 2311 Compiler Construction Course Outline
OF
AGRICULTURE AND TECHNOLOGY
Course Description
Formal treatment of programming language translation and compiler design concepts; compilers and
interpreters . Language theory. Parsing context-free languages, translation specifications and machine-
independent code optimization; main phases of compilation. Lexical analysis. Syntax analysis. Semantic
analysis. Code generation. Symbol table design. Program compilation. Loading and execution. Compilation
techniques. Optimisation. Design of a simple complete compiler.
Course Plan
WEEK DETAILS HOURS
Week 1 Introduction: Introduction to compiler construction, Phases of compilers, 5
Challenges in Compiler Design.
Week 2 Lexical Analysis: Role of lexical analyzer, specification of Tokens, 5
Regular expressions, Lexical Analysis tools
Week 3 Lexical Analysis conti: Token recognition: Non-deterministic Finite 5
Automata (NFA), Deterministic Finite Automata (DFA)
Week 4 Parsing And Parser Design: Role of parser, Grammar, 5
Context- Free Grammar.
Week 5 Parsing And Parser Design conti: Top-Down: Recursive descent 5
parsing, LL(1) parsing
Week 6 Parsing And Parser Design Conti: Bottom-Up parsing: Shift-reduce 5
parsing, LR parsing, Types of LR parsing.
Week 7 Parsing And Parser Design Conti: LR(1) parsing, LR(1) parsing
methods: SLR, Canonical LR, LALR
Week 8 Semantic Analysis: Semantics, Attribute Grammar, Synthesized Attributes, 5
Inherited Attributes
Week 9 Semantic Analysis cont: Type Checking: Static vs Dynamic checking, 5
Type expressions
Week 10 Intermediate Code Generation: Intermediate Languages, Representation 5
techniques, Syntax trees and P-code
Week 11 Intermediate Code Generation conti: Three address Code, One address 5
code, Three address Code implementation, and Generation.
Week 12 Target Code Generation: Basic block, code generation for Tree, 5
Register Allocation.
Week 13 Code Optimization: Classification of Optimization, Optimization
Techniques, Optimization Transformations. 5
Week 14 Code Optimization conti: Local Optimization, Global Optimization, 5
Data Flow Analysis.
Week 15 & 16 Examinations
1|P age
Reference Materials:
Compilers: Principles, Techniques and Tools by Aho, Lam, Sethi, and Ullman; Addison-
Wesley Pub Co, ISBN: 0201100886
Compiler Construction: Principles and practices by Kenneth C. Louden
Basics of Compiler Design, Torben Mogensen
Engineering a Compiler, 2nd edition, Keith D. Cooper and Linda Torczon
Compiler Design by Santanu Chattopadhyay
Internet Resources.
Method of Evaluation
Written End of semester Exams 70%
Two Cats 15%
Assignment and Practical 15%
Lecturer: J. Wainaina
2|P age