├── .gitignore ├── GNUmakefile ├── LICENSE ├── README.md ├── code_tests ├── code_gen.py ├── comp_test.py ├── cool_tape.tape ├── hand_made.t ├── made_bad.t ├── onesLeft.tape ├── out.tape ├── test.sh └── time.py ├── debug_comp.sh ├── gen.s ├── include ├── core │ ├── IR.h │ ├── arm_templates.h │ ├── cli.h │ ├── compiler.h │ ├── io.h │ ├── parser.h │ ├── turing.h │ └── utils.h └── cpp │ ├── O2.hpp │ ├── arm.hpp │ ├── arm_O2.hpp │ ├── asm.hpp │ ├── code_tree.hpp │ ├── history_maps.hpp │ ├── linear_fuse.hpp │ └── tape_enums.hpp ├── spec.md ├── src ├── arm_cpp │ ├── arm_O2.cpp │ ├── linear_arm.cpp │ └── tree_arm.cpp ├── core │ ├── IR.c │ ├── cli.c │ ├── compiler.c │ ├── io.c │ ├── parser.c │ └── turing.c ├── cpp │ ├── O2.cpp │ ├── asm_O2.cpp │ ├── basic_fuse.cpp │ ├── history_maps.cpp │ ├── linear_asm.cpp │ ├── linear_fuse.cpp │ └── tree_asm.cpp └── tools │ ├── arm.c │ ├── arm_treemc.cpp │ ├── interpreter.c │ ├── tape_tool.c │ ├── tmc0.c │ ├── tmc1.c │ ├── tmc2.cpp │ └── treemc.cpp ├── test.asm ├── test.py ├── test_treemc.sh └── tests ├── asm ├── Makefile ├── input.tape ├── read_write_tape └── read_write_tape.asm ├── code_samples ├── invalid │ ├── debug.tape │ ├── first.t │ ├── halt.t │ ├── left_miss.t │ ├── redef.t │ └── right_miss.t └── valid │ ├── loop.t │ ├── redundent.t │ └── valid.t ├── test_code_tree.cpp ├── test_compiler.c ├── test_cpp.cpp ├── test_io.c ├── test_parser.c ├── test_tree_parse.cpp └── test_turing.c /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/.gitignore -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/GNUmakefile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/README.md -------------------------------------------------------------------------------- /code_tests/code_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/code_gen.py -------------------------------------------------------------------------------- /code_tests/comp_test.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/comp_test.py -------------------------------------------------------------------------------- /code_tests/cool_tape.tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/cool_tape.tape -------------------------------------------------------------------------------- /code_tests/hand_made.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/hand_made.t -------------------------------------------------------------------------------- /code_tests/made_bad.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/made_bad.t -------------------------------------------------------------------------------- /code_tests/onesLeft.tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/onesLeft.tape -------------------------------------------------------------------------------- /code_tests/out.tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/out.tape -------------------------------------------------------------------------------- /code_tests/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/test.sh -------------------------------------------------------------------------------- /code_tests/time.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/code_tests/time.py -------------------------------------------------------------------------------- /debug_comp.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/debug_comp.sh -------------------------------------------------------------------------------- /gen.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/gen.s -------------------------------------------------------------------------------- /include/core/IR.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/IR.h -------------------------------------------------------------------------------- /include/core/arm_templates.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/arm_templates.h -------------------------------------------------------------------------------- /include/core/cli.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/cli.h -------------------------------------------------------------------------------- /include/core/compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/compiler.h -------------------------------------------------------------------------------- /include/core/io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/io.h -------------------------------------------------------------------------------- /include/core/parser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/parser.h -------------------------------------------------------------------------------- /include/core/turing.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/turing.h -------------------------------------------------------------------------------- /include/core/utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/core/utils.h -------------------------------------------------------------------------------- /include/cpp/O2.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/O2.hpp -------------------------------------------------------------------------------- /include/cpp/arm.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/arm.hpp -------------------------------------------------------------------------------- /include/cpp/arm_O2.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/arm_O2.hpp -------------------------------------------------------------------------------- /include/cpp/asm.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/asm.hpp -------------------------------------------------------------------------------- /include/cpp/code_tree.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/code_tree.hpp -------------------------------------------------------------------------------- /include/cpp/history_maps.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/history_maps.hpp -------------------------------------------------------------------------------- /include/cpp/linear_fuse.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/linear_fuse.hpp -------------------------------------------------------------------------------- /include/cpp/tape_enums.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/include/cpp/tape_enums.hpp -------------------------------------------------------------------------------- /spec.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/spec.md -------------------------------------------------------------------------------- /src/arm_cpp/arm_O2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/arm_cpp/arm_O2.cpp -------------------------------------------------------------------------------- /src/arm_cpp/linear_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/arm_cpp/linear_arm.cpp -------------------------------------------------------------------------------- /src/arm_cpp/tree_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/arm_cpp/tree_arm.cpp -------------------------------------------------------------------------------- /src/core/IR.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/IR.c -------------------------------------------------------------------------------- /src/core/cli.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/cli.c -------------------------------------------------------------------------------- /src/core/compiler.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/compiler.c -------------------------------------------------------------------------------- /src/core/io.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/io.c -------------------------------------------------------------------------------- /src/core/parser.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/parser.c -------------------------------------------------------------------------------- /src/core/turing.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/core/turing.c -------------------------------------------------------------------------------- /src/cpp/O2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/O2.cpp -------------------------------------------------------------------------------- /src/cpp/asm_O2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/asm_O2.cpp -------------------------------------------------------------------------------- /src/cpp/basic_fuse.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/basic_fuse.cpp -------------------------------------------------------------------------------- /src/cpp/history_maps.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/history_maps.cpp -------------------------------------------------------------------------------- /src/cpp/linear_asm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/linear_asm.cpp -------------------------------------------------------------------------------- /src/cpp/linear_fuse.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/linear_fuse.cpp -------------------------------------------------------------------------------- /src/cpp/tree_asm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/cpp/tree_asm.cpp -------------------------------------------------------------------------------- /src/tools/arm.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/arm.c -------------------------------------------------------------------------------- /src/tools/arm_treemc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/arm_treemc.cpp -------------------------------------------------------------------------------- /src/tools/interpreter.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/interpreter.c -------------------------------------------------------------------------------- /src/tools/tape_tool.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/tape_tool.c -------------------------------------------------------------------------------- /src/tools/tmc0.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/tmc0.c -------------------------------------------------------------------------------- /src/tools/tmc1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/tmc1.c -------------------------------------------------------------------------------- /src/tools/tmc2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/tmc2.cpp -------------------------------------------------------------------------------- /src/tools/treemc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/src/tools/treemc.cpp -------------------------------------------------------------------------------- /test.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/test.asm -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/test.py -------------------------------------------------------------------------------- /test_treemc.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/test_treemc.sh -------------------------------------------------------------------------------- /tests/asm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/asm/Makefile -------------------------------------------------------------------------------- /tests/asm/input.tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/asm/input.tape -------------------------------------------------------------------------------- /tests/asm/read_write_tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/asm/read_write_tape -------------------------------------------------------------------------------- /tests/asm/read_write_tape.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/asm/read_write_tape.asm -------------------------------------------------------------------------------- /tests/code_samples/invalid/debug.tape: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/invalid/debug.tape -------------------------------------------------------------------------------- /tests/code_samples/invalid/first.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/invalid/first.t -------------------------------------------------------------------------------- /tests/code_samples/invalid/halt.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/invalid/halt.t -------------------------------------------------------------------------------- /tests/code_samples/invalid/left_miss.t: -------------------------------------------------------------------------------- 1 | (S0, 1): (1 R halt) -------------------------------------------------------------------------------- /tests/code_samples/invalid/redef.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/invalid/redef.t -------------------------------------------------------------------------------- /tests/code_samples/invalid/right_miss.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/invalid/right_miss.t -------------------------------------------------------------------------------- /tests/code_samples/valid/loop.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/valid/loop.t -------------------------------------------------------------------------------- /tests/code_samples/valid/redundent.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/valid/redundent.t -------------------------------------------------------------------------------- /tests/code_samples/valid/valid.t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/code_samples/valid/valid.t -------------------------------------------------------------------------------- /tests/test_code_tree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_code_tree.cpp -------------------------------------------------------------------------------- /tests/test_compiler.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_compiler.c -------------------------------------------------------------------------------- /tests/test_cpp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_cpp.cpp -------------------------------------------------------------------------------- /tests/test_io.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_io.c -------------------------------------------------------------------------------- /tests/test_parser.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_parser.c -------------------------------------------------------------------------------- /tests/test_tree_parse.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_tree_parse.cpp -------------------------------------------------------------------------------- /tests/test_turing.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevakrien/Turing-compiler/HEAD/tests/test_turing.c --------------------------------------------------------------------------------