A toy self-hosted C compiler written in C, this compiler works on only Linux
make kcc
sh kcc.sh -o <output-file> <input-file>
sh kcc.sh -o fib examples/fib.c
./fib
+,-,*,/,%, ...expressionif,for,while,switch, ...statementint,char,short,long,void,struct,union,enum,typedefstatic,extern- variable length arguments fuction
- string, char literal
- block, line comment
- preprocess
- struct, union initialization
- no-length array initialization
- some global variable initialization
float,double,unsigned,_Bool- bitfield
- some type cast
gotoinlinefunction- function with 7 or more arguments
- function pointer
- variable length array
- number literal
- some error handling
- tag scope
build the 1st, 2nd and 3rd generation compilers and test them.
make test_all