A from-scratch compiler for the COOL (Classroom Object-Oriented Language), covering lexing, parsing, and code generation.
| Phase | Directory | Primary implementation | Status |
|---|---|---|---|
| Lexer | PA2/ |
cool.flex |
Complete |
| Parser | PA3/ |
cool.y |
Complete |
| Semantic Analyzer | PA4/ |
semant.cc |
Complete |
Most of the compiler logic for these phases lives in those two files; the rest of each directory is build tooling, drivers, and course-provided infrastructure.
cd PA2 && make && make test # build and test the lexer
cd PA3 && make && make test # build and test the parser (requires PA2 lexer)
cd PA4 && make && make test # build and test the semantic analyzer (requires PA2 lexer and PA3 parser)