mdcc is a small compiler for C programming language. I wrote this just for fun and studying low-level programming.
The frontend and the backend of mdcc are written by hand. After the abstract syntax tree is created, mdcc converts the tree into the stack machine code written in x86-64 assembly without using IR. Currently, there are lots of missing features such as struct, preprocessor, global variables and etc. But, mdcc can compile relatively complex programs like this Brain fu*ck interpreter.
- 低レイヤを知りたい人のためのCコンパイラ作成入門 (by Rui Ueyama) ... The book describes how to make C compiler by incremental development.
- 9cc (by Rui Ueyama) ... A readable C compiler implementation. I read the code when I stambled.
- BNF notation for C
- ABI for x86-64
- C99 specification