The following are powerpoint slides (and associated code) from the lectures.
- Lecture 1
- Lecture 2
- Lecture 3
- Lecture #3. Monday, Jan 22, 2007.
- Answers to Assignment #2. Review pattern matching,
recursion, and use of let for local variables. Librearies,
References, While Loops, Accumulating parameter functions.
Regular Expressions as programs. RE to NFA.
- Power Point Slides
- Code from the notes
- Lecture 4
- Lecture #4. Wednesday, Jan 24, 2007.
- Representing sets as lists, the cross product of two sets,
epsilon transitions, epsilon - closure, Interpreting an NFA,
NFA to DFA.
- Power Point Slides
- Code from the notes
- Lecture 5
- Lecture 6
- Lecture #6. Wednesday, Jan 31, 2007.
- More about SML-Lex, The compiler manager, More about library functions over lists (map,filter,find,exists,foldr).
- Power Point Slides
- Code from the notes
- Lecture 7
- Lecture #7. Monday, Feb 5, 2007.
- Grammars, Top down parsing, Transition Diagrams, Ambiguity, Left recursion,
Refactoring by adding levels, Recursive descent parsing, Predictive Parsers,
First and Follow, Parsing tables.
- Power Point Slides
- Code from the notes
- Lecture 8
- Lecture #8 Wednesday, Feb 7, 2007.
- Shift-reduce parsing,
Shift-reduce and reduce-reduce conflicts,
Precedence parsing,
LR parsers,
LR parsers and FSAs,
LR parsing Tables,
Sets of Items construction.
- Power Point Slides
- Lecture 9
- Lecture 10
- Lecture #10 Wednesday, Feb 14, 2007.
- Modified sets of item construction,
Rules for building LR parse tables,
The Action rules,
The GOTO rules,
Conflicts and ambiguity,
Shift-reduce and reduce-reduce conflicts,
Parser generators and ambiguity,
Ambiguous expression grammar,
Ambiguous if-then-else grammar,
Ml-yacc.
- Power Point Slides
- A directory of Ambiguous Examples in ml-yacc.
- Lecture 11
- Lecture #11 Monday, Feb 19, 2007.
- ml-Yacc, Actions when reducing, Making ml-yacc work with ml-lex,
Boiler plate.
- Power Point Slides
- Lecture 12
- Basic Types, Constructed Types, Representing types as data,
Describing type systems as rules, Type rules for ML, Type equality,
Type coercions, Sub typing.
Purpose of type systems, Kinds of type systems, Primitive types,
Constructed types, Type checking, Attribute grammars, Inherited attributes,
Synthesized attributes, Adding attributes to trees, Programs for computing attribute computations.
- Power Point Slides
- Lecture 13
- Lecture 14 (Guest Lecturer by Jim Hook, Feb 28, 2007)
- Writing type-checkers in ML,
Role of type rules,
Representing types,
Representing programs,
Handling errors,
Guessing types,
Declarations,
Let expressions.
- Power Point Slides
- Code from the notes.
- Lecture 15
- Judgments for mini-Java,
Multiple type environments,
Class Hierarchy,
Setting up an ML typechecker for mini-Java,
Subtyping,
Rules for Java,
Declarations as functions over environments.
- Power Point Slides
- Lecture 16
- Lecture 17
- Procedure Abstraction,
Name Spaces,
Scoping Rules,
Activation Records,
Object Oriented Languages,
Parameter Passing,
Returning Values.
- Power Point Slides
- Lecture 18
- Syntax directed translations,
Meanings of programs,
Rules for writing a compiler,
Intermediate code
Pascal-like language
Run-time environments
Calling sequence
Variable references.
- Power Point Slides
- Code from the notes.
Additional notes to be posted here as lectures are given.
Lecture 19
Lecture 13
Lecture 18
Lecture 20
- Displays, Memory Layout, Heap Allocation, Garbage Collection,
Translating Mini Java.
- Power Point Slides
Back to CS 321, Languages and Compiler Design, Home Page