Lecture Resources

Note that the last time the course was offered was online during lockdown, so we might have to play with the schedule a bit (not sure if we'll be moving faster or slower in different parts).

Week Topics and resources
Sept 5-9 Course overview, administrivia
Compilation
- overview: youtube, slides
- key steps: youtube, slides
No labs (due to Labour Day on the 5th)
Sept 12-16 ... this week's material might expand into the following week, ...
Intro to grammars, lex, and yacc
- Formal descriptions of languages: youtube, slides
- Regular expressions: youtube, slides
- Context free grammars: youtube, slides
- lex and yacc (old webnotes/examples)
- lex/flex (tokenizer): youtube, slides
- yacc/bison (parser): youtube, slides
Sept 19-23 Note: the university is closed Monday Sept 19th, no labs/lectures
Language features continued:
- Augmented context-free grammars: youtube, slides
Ad hoc context-sensitive analysis: youtube, slides
Handling types and type checking: youtube, slides
Sept 26-30 Note: the university is closed Friday Sept 30th, no labs/lectures
... and we spend much of the week finishing the augmented grammars ...
Language features: viutube, slides
Scanners/tokenizing
- intro: youtube, slides
Oct 3-7 Scanners/tokenizing continued
- FSM practice: youtube, slides
- a simple hand-crafted tokenizer youtube
Transforming regexes to minimized DFAs: youtube, slides
Oct 10-14 Note: no labs this week, the university is closed Monday Oct. 10th
- Thompson's construction: youtube, slides
- Subset construction: youtube, slides
- Hopcroft's algorithm: youtube, slides
Oct 17-21 Scanner code generation (from DFA)
- intro: youtube, slides
- table-driven scanners: youtube, slides
- direct-coded scanners: youtube, slides
- hand-coded scanners: youtube, slides
Parsers/parsing
- intro: youtube, slides
- Top-down parsing: youtube, slides
Oct 24-28 - recursive descent, LL(1): youtube, slides
A simple hand-crafted parser: youtube
Oct 31-N4 Bottom-up parsing
- intro youtube, slides
- using action/goto tables: youtube, slides
- parsing considerations: youtube, slides
Nov 7-11 Study week: no lectures/labs
Nov 14-18 Attribute grammar frameworks: youtube, slides
Intermediate representations
- intro: youtube, slides
- Syntax trees, graphs: youtube, slides
- Linear codes: youtube, slides
Nov 21-25 - modeling and application: youtube, slides
- Subroutine abstraction: youtube, slides
- Activation records: youtube, slides
Code generation and structure
- Code shape and storage allocation: youtube, slides
Nov 28-D2 - Code generation, tree walking: youtube, slides
- Primitive types and operators (arithmetic, booleans, characters): youtube, slides
- other types: arrays, structs, unions, pointers: youtube, slides

- Iteration and selection: youtube, slides
- Subroutine calls: youtube, slides
Optimization I:
- overview: levels of optimization youtube, slides

Dec 5-9 Optimization continued...
- Local/block optimization: youtube, slides
- Regional optimization: youtube, slides
- Intraprocedural("global") optimization: youtube, slides
- Interprocedural (whole-program) optimization: youtube, slides
- Data flow analysis: iterative: youtube, slides
- SSA and uses: youtube, slides
- Whole-program analysis, optimizations, register allocation: youtube, slides

Course wrap-up/review
Project presentation schedule: Wed lecture and lab
Wed in lecture room                 Wed in lab room
11:30 James                         3:30 Finn
11:45 Ahn                           3:45 Brandon
12:00 Janina                        4:00 Devam
12:15 Liam                          4:15 Gagandeep
12:30 Naman                         4:30 Jimmy
                                    4:45 Brayden
                                    5:00 Rashad
    
Supplemental:
- Heap management: youtube, slides Case study: GNU malloc approach
- memory organization: slides, youtube
- allocate/free algorithms: slides, youtube
External resource: GNU malloc (sourceware.org)
Aggregate data types
- arrays: slides, C++ example, youtube
- records/structures: slides, C++ example, youtube
- OO languages/issues: youtube, slides
- C++ OO implementation: slides, youtube
    (whoops: in slide 3, the definition of foo inside the class is incomplete, it was supposed to be returning x+i)