Compilers


Spring 2024

Grace Hopper in 1952

Documents

Books

Projects and Labs

  • Embrace scholarship and write your labs using LaTeX. OverLeaf is probably the easiest way to do this. I've written a lab example you can use as a template. There are more LaTeX resources below.
  • Most of the labs feed into the projects. Get started by looking at Our Language Grammar. Also have a look at the resources below to help get you started.
  • Stop writing in pseudo code!
  • Project One - Build an interesting lexer.
    • Lab 1: Making tokens with your Lexer
    • Lab 2: More token making, now with Finite Automata
  • Project Two - Build an interesting parser and CST.
    • Lab 3: Turning tokens into sentences with your Parser
    • Lab 4: Analyzing Grammars
    • Lab 5: Building Syntax Trees both Concrete and Abstract
  • Project Three - Adding an AST and Semantic Analysis.
    • Lab 5: Building Syntax Trees both Concrete and Abstract
    • Lab 6: Symbol tables and you (and your compiler)
    • Lab 7: Semantic Analysis: Checking scope and type
  • Project Four - A full compiler, with 6502a code generation.

Examples

Notes

Resources

Wirth's original Pascal compiler on DEC tape

Articles

Past Project Hall of Fame

JavaScript or TypeScript projects only. There have been some fantastic projects in Scala, C++, Java, (and even Python once, but never again), and other languages, but they (obviously) will not execute in a web browser.
I reserve the copyright for all parts of my courses. Commercial reproduction of any course material, including lecture notes taken by students, without my EXPRESS WRITTEN consent, is prohibited. Seriously.