Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 785 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 785 Bytes

pycc

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:

  • Blog Post
  • pylox - language i wrote based on the book Crafting Interpreters