Course Overview
|
Course Synopsis
|
The course introduces the students to the operation of a modern compiler that translates code in a programming language into machine code. Special emphasis is placed on the actual construction of a compiler by working on a project that builds a compiler for a language that is a subset of C++.
Modern compilers operate in three passes. These are front-end, middle end and back end. Given a program written in a programming language, the front end carries out syntax analysis of input program. The middle end performs code optimization so that the eventual executable program will require less memory and will be efficient at runtime. The back end generates actual assembly language code for the target machine. We will study mechanics of the three stages. However, due to the introductory nature of the course, we will spend majority of the time on syntax analysis and code generation. We will touch upon optimization briefly.
The course provides a practical opportunity to see how concepts and techniques from various areas of Computer Science come together to build a useful tool.
|
Course Learning Outcomes
|
At the end of the course, you should be able to
- Translate and interpret computer languages,
- The basic theory of compilers.
- Evaluate the issues involved in implementing a compiler
- Better knowledge about how a compiler works
- Design parsers and compilers for any language
|
Course Calendar
|
|
|
|
Week 02
|
6
|
Specification of Tokens
|
Week 03
|
9
|
DFA State Minimization, Lex
|
Week 04
Quiz 1
|
12
|
CFG, Ambiguity, Precedence
|
Week 05
|
15
|
Recursive Descent Parsing
|
Assignment 1
Week 06
GDB
Week 07
|
19
|
LL Parsing Table Construction, Left Factoring
|
Quiz 2
Week 08
|
22
|
Shift-Reduce Parsing: Finding Handles
|
Mid Term Exams
Week 09
|
26
|
LR(1) Canonical Collection of Items
|
|
27
|
LR(1) Parsing Table Construction
|
Week 10
|
28
|
LR(1) Parsing, Shift-Reduce Conflicts
|
|
30
|
Parser Generators - YACC
|
Quiz 3
Week 11
|
33
|
Ad-hoc scheme for attribute grammars
|
Assignment 2
Week 12
|
34
|
Ad-hoc scheme, Intermediate Representation (IR)
|
|
35
|
Intermediate Representation taxonomy
|
|
36
|
Syntax-directed translation: assignment statement
|
Week 13
|
37
|
Syntax-directed translation: control flow statement
|
|
38
|
Syntax-directed translation: boolean expression
|
|
39
|
Syntax-directed translation: back patching
|
Week 14
|
40
|
Syntax-directed translation: back patching, type checking
|
Quiz 4
Week 15
|
43
|
Code Generation: Basic Blocks
|
|
44
|
Code Generation: Register Allocation
|
Final Term Exams
|
|
|