CS 5641: Compiler Design
Fall 2002
Lecturer:
Rich Maclin
(rmaclin)
Teaching Assistant:
Ruinan (Renie) Lu
Syllabus
Grades
Lab Suggestions
Documentation:
gdb
flex
bison
Sample Exam Questions:
Midterm 1
Midterm 2
Final
Class Materials:
Introduction
Parts of a Compiler, Types of Programming Languages
Lexical Analysis
Introduction, Finite State Machines
Regular Expressions, NFSMs, DFSMs, Translation
Scanner Implementation
Sample code (gziped tar file)
Parsing
Introduction, Context Free Grammars, Languages, Derivations
Ambiguity, Precedence, Associativity
Top Down Parsing, Recursive Descent, Predictive Parsing, LL(1), First and Follow sets
Bottom Up Parsing, Shift and Reduce, Conflicts
SLR Parsing, SLR States
(PDF, 6 Per Page)
Constructing SLR States, LR(1) Parsing, LALR Parsing
Semantic Analysis
Syntax-Directed Translation, Parse Trees, Abstract Syntax Trees
Implementation Example with Bison, LL(1) Grammar
Code for a simple bison and corresponding LL(1) parser
Scoping
Parameter Passing
Symbol Table Implementation
Type Checking
Interpreters
Code Generation
Memory Management
Code Generation I
Code Generation II
Local Optimization
Project Parts:
Teams
Part 1
Part 2
Part 3
Part 4
Part 5
Homework Assignments:
Homework 1
Homework 2
Homework 3
Homework 4
C++ Notes (from 1622/1521) based on
Learning C++: A Hands-On Approach
by Nagler
Intro to C++
C++ Input and Output
C++ Other Features
C++ Classes