A compiler for the Decaf language, built in a team of two over one month at IIIT Hyderabad — lexing and parsing with Flex and Bison, code generation with LLVM. Code and project report on GitHub.
- Halfway through, we decided to implement semantics beyond what the project spec required
- The hardest part was generating phi nodes for control flow — LLVM's documentation didn't provide the function descriptors we needed, so we worked it out from source and experimentation
- Understanding how Flex and Bison actually fit together let us write our own Makefile from scratch
My favorite code review I've ever received, from our professor:
"... I checked your code. It seems to work. So both of you need not take the exam. Good job."