Creating a C compiler for x86 machines in python
- Install python-2.7 and pip2 in your machine
- Install ply :
pip install ply
- Install pydot :
pip install pydot
For generating parse tree on test example
cd <project-top>/src
python2 cparser.py ../test/<filename> <graph_name.png>
Graph will be generated in the test directory
For generating .S files for given .C file
cd <project-top>/test
python2 ../src/code_generation.py <filename>
Output files named a.S will be generated. Which can be further used by assembler to generate .out binary file.
./run.sh
- For ANSI C Grammer C Lex C Yacc GRAMMAR
- PLY python tool for Lex and Yacc PLY
- PyDot library in python PyDot
- PLY Examples
- Test Examples - merge-sort, Quick Sort, Integer Sum. DFS & Stack
- Bhangale Pratik Anil (14173)
- Shibhansh Dohare (14644)