cs143.stanford.edu
Lectures
- SU-CS143 APR012025
- SU-CS143 APR032025
- SU-CS143 APR152025
- SU-CS143 APR172025
- SU-CS143 APR242025
- SU-CS143 APR292025
Lexing
- What to do: SU-CS143 APR082025
- How to implement it: SU-CS143 APR102025
Logistics
- programming assignments: myth
- psets: gradescope
- labs: myth.stanford.edu
- /afs/ir/class/cs143
- finals and midterms
Textbook: the purple dragonbook
Structure
- written assignments (2.5*4 = 10%)
- programming assignments (10+10+15+15 = 50%); 4 of them
- lexer
- parser
- semantic analysis parse
- code generator
- midterm (15%)
- final (25%)
Compiler we will Build
- lexer: strings -> tokens
- built with Flex FSTs
- smallest part of the code
- parser: tokens -> AST
- built with Bison CFGs
- linear time parsing!
- semantic analysis: AST
- C++
- check types + properties
- fill in types for expressions in the tree
- [PA5: optimization - TBD]
- code generation: AST -> MIPS
- C++
- write MIPS
- yay!
Emphasis: correctness over performance.