├── .gitignore ├── GramOrigin ├── function.cpp ├── function.h ├── grammer.cpp ├── grammer.h ├── lexical.cpp ├── lexical.h ├── main.cpp ├── midCode.cpp ├── midCode.h ├── mipsCode.cpp ├── mipsCode.h └── symbolItem.h ├── README.md ├── function.cpp ├── function.h ├── grammer.cpp ├── grammer.h ├── lexical.cpp ├── lexical.h ├── main.cpp ├── midCode.cpp ├── midCode.h ├── mipsCode.cpp ├── mipsCode.h ├── optimize.cpp ├── optimize.h ├── symbolItem.h ├── test ├── error-CALL.txt ├── error-PUTARRAY.txt ├── error-比较运算符.txt ├── sRegTest.txt ├── sRegTestRes.txt ├── test │ ├── 16061160_test1.txt │ ├── 16061160_test10.txt │ ├── 16061160_test11.txt │ ├── 16061160_test12.txt │ ├── 16061160_test13.txt │ ├── 16061160_test2.txt │ ├── 16061160_test3.txt │ ├── 16061160_test4.txt │ ├── 16061160_test5.txt │ ├── 16061160_test6.txt │ ├── 16061160_test7.txt │ ├── 16061160_test8.txt │ ├── 16061160_test9.txt │ ├── 16231246.txt │ ├── czy.txt │ ├── fc.txt │ ├── mee │ │ ├── testfile1.txt │ │ ├── testfile2.txt │ │ ├── testfile3.txt │ │ ├── testfile4.txt │ │ ├── testfile5.txt │ │ └── testfile6.txt │ ├── mzy.txt │ ├── old16231246.txt │ ├── qys.txt │ ├── testFibnaci.txt │ ├── testarray.txt │ ├── testbigparatable.txt │ ├── testclang.txt │ ├── testcompute.txt │ ├── testdeeppara.txt │ ├── testfile1.txt │ ├── testfile2.txt │ ├── testfile3.txt │ ├── testfile4.txt │ ├── testfile6.txt │ ├── testfile7.txt │ ├── testfile8.txt │ ├── testfile9.txt │ ├── testfunction.txt │ ├── testglobalandlocal.txt │ ├── testio.txt │ ├── testloop.txt │ ├── testmergesort.txt │ ├── testprime.txt │ ├── testpublic3.txt │ ├── testsmallfunction.txt │ └── teststoreload.txt ├── use-def错误.txt ├── 代码生成样例.txt ├── 文法.txt ├── 新建文本文档.txt ├── 竞速.txt ├── 竞速排序输出.txt ├── 错误处理前导0.txt └── 错误处理样例.txt ├── 编译申优文档.md └── 编译申优文档.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | /*.txt 2 | /Debug 3 | Gram.* 4 | *.zip 5 | *.rar -------------------------------------------------------------------------------- /GramOrigin/function.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/function.cpp -------------------------------------------------------------------------------- /GramOrigin/function.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/function.h -------------------------------------------------------------------------------- /GramOrigin/grammer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/grammer.cpp -------------------------------------------------------------------------------- /GramOrigin/grammer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/grammer.h -------------------------------------------------------------------------------- /GramOrigin/lexical.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/lexical.cpp -------------------------------------------------------------------------------- /GramOrigin/lexical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/lexical.h -------------------------------------------------------------------------------- /GramOrigin/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/main.cpp -------------------------------------------------------------------------------- /GramOrigin/midCode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/midCode.cpp -------------------------------------------------------------------------------- /GramOrigin/midCode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/midCode.h -------------------------------------------------------------------------------- /GramOrigin/mipsCode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/mipsCode.cpp -------------------------------------------------------------------------------- /GramOrigin/mipsCode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/mipsCode.h -------------------------------------------------------------------------------- /GramOrigin/symbolItem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/GramOrigin/symbolItem.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/README.md -------------------------------------------------------------------------------- /function.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/function.cpp -------------------------------------------------------------------------------- /function.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/function.h -------------------------------------------------------------------------------- /grammer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/grammer.cpp -------------------------------------------------------------------------------- /grammer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/grammer.h -------------------------------------------------------------------------------- /lexical.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/lexical.cpp -------------------------------------------------------------------------------- /lexical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/lexical.h -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/main.cpp -------------------------------------------------------------------------------- /midCode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/midCode.cpp -------------------------------------------------------------------------------- /midCode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/midCode.h -------------------------------------------------------------------------------- /mipsCode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/mipsCode.cpp -------------------------------------------------------------------------------- /mipsCode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/mipsCode.h -------------------------------------------------------------------------------- /optimize.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/optimize.cpp -------------------------------------------------------------------------------- /optimize.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/optimize.h -------------------------------------------------------------------------------- /symbolItem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/symbolItem.h -------------------------------------------------------------------------------- /test/error-CALL.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/error-CALL.txt -------------------------------------------------------------------------------- /test/error-PUTARRAY.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/error-PUTARRAY.txt -------------------------------------------------------------------------------- /test/error-比较运算符.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/error-比较运算符.txt -------------------------------------------------------------------------------- /test/sRegTest.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/sRegTest.txt -------------------------------------------------------------------------------- /test/sRegTestRes.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/sRegTestRes.txt -------------------------------------------------------------------------------- /test/test/16061160_test1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test1.txt -------------------------------------------------------------------------------- /test/test/16061160_test10.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test10.txt -------------------------------------------------------------------------------- /test/test/16061160_test11.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test11.txt -------------------------------------------------------------------------------- /test/test/16061160_test12.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test12.txt -------------------------------------------------------------------------------- /test/test/16061160_test13.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test13.txt -------------------------------------------------------------------------------- /test/test/16061160_test2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test2.txt -------------------------------------------------------------------------------- /test/test/16061160_test3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test3.txt -------------------------------------------------------------------------------- /test/test/16061160_test4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test4.txt -------------------------------------------------------------------------------- /test/test/16061160_test5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test5.txt -------------------------------------------------------------------------------- /test/test/16061160_test6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test6.txt -------------------------------------------------------------------------------- /test/test/16061160_test7.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test7.txt -------------------------------------------------------------------------------- /test/test/16061160_test8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test8.txt -------------------------------------------------------------------------------- /test/test/16061160_test9.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16061160_test9.txt -------------------------------------------------------------------------------- /test/test/16231246.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/16231246.txt -------------------------------------------------------------------------------- /test/test/czy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/czy.txt -------------------------------------------------------------------------------- /test/test/fc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/fc.txt -------------------------------------------------------------------------------- /test/test/mee/testfile1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mee/testfile1.txt -------------------------------------------------------------------------------- /test/test/mee/testfile2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mee/testfile2.txt -------------------------------------------------------------------------------- /test/test/mee/testfile3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mee/testfile3.txt -------------------------------------------------------------------------------- /test/test/mee/testfile4.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } -------------------------------------------------------------------------------- /test/test/mee/testfile5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mee/testfile5.txt -------------------------------------------------------------------------------- /test/test/mee/testfile6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mee/testfile6.txt -------------------------------------------------------------------------------- /test/test/mzy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/mzy.txt -------------------------------------------------------------------------------- /test/test/old16231246.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/old16231246.txt -------------------------------------------------------------------------------- /test/test/qys.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/qys.txt -------------------------------------------------------------------------------- /test/test/testFibnaci.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testFibnaci.txt -------------------------------------------------------------------------------- /test/test/testarray.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testarray.txt -------------------------------------------------------------------------------- /test/test/testbigparatable.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testbigparatable.txt -------------------------------------------------------------------------------- /test/test/testclang.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testclang.txt -------------------------------------------------------------------------------- /test/test/testcompute.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testcompute.txt -------------------------------------------------------------------------------- /test/test/testdeeppara.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testdeeppara.txt -------------------------------------------------------------------------------- /test/test/testfile1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile1.txt -------------------------------------------------------------------------------- /test/test/testfile2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile2.txt -------------------------------------------------------------------------------- /test/test/testfile3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile3.txt -------------------------------------------------------------------------------- /test/test/testfile4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile4.txt -------------------------------------------------------------------------------- /test/test/testfile6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile6.txt -------------------------------------------------------------------------------- /test/test/testfile7.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile7.txt -------------------------------------------------------------------------------- /test/test/testfile8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile8.txt -------------------------------------------------------------------------------- /test/test/testfile9.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfile9.txt -------------------------------------------------------------------------------- /test/test/testfunction.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testfunction.txt -------------------------------------------------------------------------------- /test/test/testglobalandlocal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testglobalandlocal.txt -------------------------------------------------------------------------------- /test/test/testio.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testio.txt -------------------------------------------------------------------------------- /test/test/testloop.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testloop.txt -------------------------------------------------------------------------------- /test/test/testmergesort.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testmergesort.txt -------------------------------------------------------------------------------- /test/test/testprime.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testprime.txt -------------------------------------------------------------------------------- /test/test/testpublic3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testpublic3.txt -------------------------------------------------------------------------------- /test/test/testsmallfunction.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/testsmallfunction.txt -------------------------------------------------------------------------------- /test/test/teststoreload.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/test/teststoreload.txt -------------------------------------------------------------------------------- /test/use-def错误.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/use-def错误.txt -------------------------------------------------------------------------------- /test/代码生成样例.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/代码生成样例.txt -------------------------------------------------------------------------------- /test/文法.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/文法.txt -------------------------------------------------------------------------------- /test/新建文本文档.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/新建文本文档.txt -------------------------------------------------------------------------------- /test/竞速.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/竞速.txt -------------------------------------------------------------------------------- /test/竞速排序输出.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/竞速排序输出.txt -------------------------------------------------------------------------------- /test/错误处理前导0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/错误处理前导0.txt -------------------------------------------------------------------------------- /test/错误处理样例.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/test/错误处理样例.txt -------------------------------------------------------------------------------- /编译申优文档.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/编译申优文档.md -------------------------------------------------------------------------------- /编译申优文档.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aptx1231/BUAA_Compiler/HEAD/编译申优文档.pdf --------------------------------------------------------------------------------