Loading repository data…
Loading repository data…
yann-shi / repository
Compiler for C language in python
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
详细要求见http://os.hit.edu.cn/?p=7
--------V2.0------------
--------V1.0------------
帮助:
python compiler.py -h
查看词法分析结果:
python compiler.py -s source.c -l
查看语法树:
python compiler.py -s source.c -p
生成汇编:
python compiler.py -s source.c -a
将汇编文件编译成二进制:
gcc source.S -o source
生成的汇编文件仅能在linux在编译,OS X虽然是unix like, 但是其gcc编译器与linux下的生成语法不同
只实现了该网站中出现的语法句型,还有很多语法状态没有实现。 比如,不支持嵌套的控制语句等。