Simple c compiler & interpreter written in python
- Python3
$ conda install --file requirements.txt
$ pip install -r requirements.txt
$ python interpreter.py [-h] [--debug] Input_File
$ python interpreter.py ./sample/base.c
Run 'number' of lines
>> next
>> next 100
Print stored value of variable
>> print a
Trace history of variable
>> trace a
Write optimized .c file
$ python optimizer.py [-h] [--debug] Input_File Output_File
$ python optimizer.py --debug ./sample/constant_folding.c ./sample/constant_folding_o.c
- Interpreter
- Recursive Function Call
- Optimizer
- Constant Folding
- Dead Code Elimination