├── .editorconfig ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── Setup.hs ├── imp.cabal ├── lib ├── IMP │ ├── AST.hs │ ├── Codegen │ │ ├── Error.hs │ │ ├── GlobalCodegen.hs │ │ ├── SubCodegen.hs │ │ └── Utils.hs │ ├── Emit.hs │ ├── Parser.hs │ ├── Parser │ │ └── Error.hs │ ├── SourceLoc.hs │ ├── SymbolTable.hs │ └── Types.hs └── Test │ └── Tasty │ └── IMP.hs ├── package.yaml ├── src └── Main.hs ├── stack.yaml ├── stdlib ├── impstd.c └── impstd.h └── test ├── CompilerTests.hs ├── IMP └── Test │ ├── Parser.hs │ └── Tests.hs ├── TestSuite.hs └── examples ├── fibi.imp ├── fibi.stdin ├── fibi.stdout ├── fibi_no_rec.imp ├── fibi_no_rec.stdin ├── fibi_no_rec.stdout ├── gcd.imp ├── gcd.stdin ├── gcd.stdout ├── global.imp ├── global.stdin ├── global.stdout ├── hello.imp ├── hello.stdout ├── integer_lit_overflow.imp ├── simple.imp ├── simple.stdout ├── sum.imp ├── sum.stdin ├── sum.stdout ├── test_inout.imp ├── test_inout.stdout ├── test_sub_input.imp ├── test_sub_input.stdin └── test_sub_input.stdout /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/.editorconfig -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/.travis.yml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/README.md -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /imp.cabal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/imp.cabal -------------------------------------------------------------------------------- /lib/IMP/AST.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/AST.hs -------------------------------------------------------------------------------- /lib/IMP/Codegen/Error.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Codegen/Error.hs -------------------------------------------------------------------------------- /lib/IMP/Codegen/GlobalCodegen.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Codegen/GlobalCodegen.hs -------------------------------------------------------------------------------- /lib/IMP/Codegen/SubCodegen.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Codegen/SubCodegen.hs -------------------------------------------------------------------------------- /lib/IMP/Codegen/Utils.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Codegen/Utils.hs -------------------------------------------------------------------------------- /lib/IMP/Emit.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Emit.hs -------------------------------------------------------------------------------- /lib/IMP/Parser.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Parser.hs -------------------------------------------------------------------------------- /lib/IMP/Parser/Error.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Parser/Error.hs -------------------------------------------------------------------------------- /lib/IMP/SourceLoc.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/SourceLoc.hs -------------------------------------------------------------------------------- /lib/IMP/SymbolTable.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/SymbolTable.hs -------------------------------------------------------------------------------- /lib/IMP/Types.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/IMP/Types.hs -------------------------------------------------------------------------------- /lib/Test/Tasty/IMP.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/lib/Test/Tasty/IMP.hs -------------------------------------------------------------------------------- /package.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/package.yaml -------------------------------------------------------------------------------- /src/Main.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/src/Main.hs -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/stack.yaml -------------------------------------------------------------------------------- /stdlib/impstd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/stdlib/impstd.c -------------------------------------------------------------------------------- /stdlib/impstd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/stdlib/impstd.h -------------------------------------------------------------------------------- /test/CompilerTests.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/CompilerTests.hs -------------------------------------------------------------------------------- /test/IMP/Test/Parser.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/IMP/Test/Parser.hs -------------------------------------------------------------------------------- /test/IMP/Test/Tests.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/IMP/Test/Tests.hs -------------------------------------------------------------------------------- /test/TestSuite.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/TestSuite.hs -------------------------------------------------------------------------------- /test/examples/fibi.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/fibi.imp -------------------------------------------------------------------------------- /test/examples/fibi.stdin: -------------------------------------------------------------------------------- 1 | 20 2 | 3 | -------------------------------------------------------------------------------- /test/examples/fibi.stdout: -------------------------------------------------------------------------------- 1 | Enter number: Result is: 6765 2 | -------------------------------------------------------------------------------- /test/examples/fibi_no_rec.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/fibi_no_rec.imp -------------------------------------------------------------------------------- /test/examples/fibi_no_rec.stdin: -------------------------------------------------------------------------------- 1 | 46 2 | -------------------------------------------------------------------------------- /test/examples/fibi_no_rec.stdout: -------------------------------------------------------------------------------- 1 | Enter number: Result is: 1836311903 2 | -------------------------------------------------------------------------------- /test/examples/gcd.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/gcd.imp -------------------------------------------------------------------------------- /test/examples/gcd.stdin: -------------------------------------------------------------------------------- 1 | 4200 2 | 3528 3 | -------------------------------------------------------------------------------- /test/examples/gcd.stdout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/gcd.stdout -------------------------------------------------------------------------------- /test/examples/global.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/global.imp -------------------------------------------------------------------------------- /test/examples/global.stdin: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /test/examples/global.stdout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/global.stdout -------------------------------------------------------------------------------- /test/examples/hello.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/hello.imp -------------------------------------------------------------------------------- /test/examples/hello.stdout: -------------------------------------------------------------------------------- 1 | Hello World! 2 | -------------------------------------------------------------------------------- /test/examples/integer_lit_overflow.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/integer_lit_overflow.imp -------------------------------------------------------------------------------- /test/examples/simple.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/simple.imp -------------------------------------------------------------------------------- /test/examples/simple.stdout: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/examples/sum.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/sum.imp -------------------------------------------------------------------------------- /test/examples/sum.stdin: -------------------------------------------------------------------------------- 1 | 123 2 | -10 3 | -------------------------------------------------------------------------------- /test/examples/sum.stdout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/sum.stdout -------------------------------------------------------------------------------- /test/examples/test_inout.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/test_inout.imp -------------------------------------------------------------------------------- /test/examples/test_inout.stdout: -------------------------------------------------------------------------------- 1 | 42 2 | 43 3 | 84 4 | 86 5 | -------------------------------------------------------------------------------- /test/examples/test_sub_input.imp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugmes/imp/HEAD/test/examples/test_sub_input.imp -------------------------------------------------------------------------------- /test/examples/test_sub_input.stdin: -------------------------------------------------------------------------------- 1 | 45 2 | -------------------------------------------------------------------------------- /test/examples/test_sub_input.stdout: -------------------------------------------------------------------------------- 1 | Enter integer: 45 2 | --------------------------------------------------------------------------------