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
|
6
|
Specification of Tokens
|
9
|
DFA State Minimization, Lex
|
12
|
CFG, Ambiguity, Precedence
|
15
|
Recursive Descent Parsing
|
19
|
LL Parsing Table Construction, Left Factoring
|
22
|
Shift-Reduce Parsing: Finding Handles
|
26
|
LR(1) Canonical Collection of Items
|
27
|
LR(1) Parsing Table Construction
|
28
|
LR(1) Parsing, Shift-Reduce Conflicts
|
30
|
Parser Generators - YACC
|
33
|
Ad-hoc scheme for attribute grammars
|
34
|
Ad-hoc scheme, Intermediate Representation (IR)
|
35
|
Intermediate Representation taxonomy
|
36
|
Syntax-directed translation: assignment statement
|
37
|
Syntax-directed translation: control flow statement
|
38
|
Syntax-directed translation: boolean expression
|
39
|
Syntax-directed translation: back patching
|
40
|
Syntax-directed translation: back patching, type checking
|
43
|
Code Generation: Basic Blocks
|
44
|
Code Generation: Register Allocation
|
46
|
Assignment on Emerging Trends
|
|
|
|