文件名称:compiler:基本C编译器(用python编写)
文件大小:37KB
文件格式:ZIP
更新时间:2024-04-01 19:15:16
Python
编译器 基本C编译器(用python编写) 细节 Python版本: 3.8.5 x64 组装架构: x64 汇编语法: AT&T语法 跑 Linux $ chmod u+x ./compiler.py $ ./compiler.py test.c OR python3 ./compiler.py test.c (Generates test.s in the current directory) $ gcc test.s $ ./a.out 视窗 = Change the name of the module parser.py to something else (parser_w.py for example), then change "import Parser from parser" to "import Parser fr
【文件预览】:
compiler-main
----error_print.py(3KB)
----compiler.py(868B)
----token.py(5KB)
----typesAST.py(9KB)
----test.c(1KB)
----lexer.py(853B)
----code_generator.py(60KB)
----parser.py(29KB)
----examples()
--------ex-func-ptr.c(624B)
--------ex-func-call.s(16KB)
--------ex-quicksort.c(1KB)
--------ex-array-2.s(7KB)
--------ex-array-1.s(5KB)
--------ex-linked-list.s(8KB)
--------ex-func-ptr.s(5KB)
--------ex-pointers.s(4KB)
--------a.out(16KB)
--------ex-array-1.c(571B)
--------ex-func-call.c(1KB)
--------ex-linked-list.c(1KB)
--------ex-array-2.c(687B)
--------ex-pointers.c(552B)
--------ex-struct.s(20KB)
--------ex-struct.c(2KB)
--------ex-quicksort.s(14KB)
----README.md(2KB)
----test.s(8KB)