A Tiny C Compiler written in Python
Based on Nora Sandler's blog
- It can handle basic C code, like functions (recursive functions need a little tweaking)
Usage:
python main.py <input_file.c>
- For running each stage separately use the following flags
options:
-h, --help show this help message and exit
-l, --lex Print tokens from lexical analysis
-p, --parse Show parsing completion status
-cg, --codegen Print generated assembly code
--all Enable all output phases
References: