diff options
[IPL/T] Overhauled how functions are handled, added list type
1 files changed, 14 insertions, 5 deletions
| -rw-r--r-- | Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp | 19 |
diff --git a/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp b/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp index 7fc9bcf..319f408 100644 --- a/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp +++ b/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp @@ -1,18 +1,27 @@ #include <iostream> #include <deque> #include "LLVMVisitor/LLVMVisitor.h" -#include "Value/Function/BuiltInFunction.h" +#include "Value/Function/Funcall.h" int main() { LLVMVisitor visitor("testout.ll"); std::deque<Value*> nodes = { - new BuiltInFunction("+", { + new Funcall("+", { new Float(1), + new Funcall("-", { new Float(5), new Float(10) }), new Float(2), - new BuiltInFunction("-", { new Float(5), new Float(10) }), - new Float(123) }) }; + new Float(123) }), + new Funcall("defun", { + new Name("notfun"), + new List({new Name("a"), new Name("b")}), + new Funcall("+", { + new Integer(7), + new Name("a"), + new Name("b") + }) }) + }; for (Value* n : nodes) { n->Visit(visitor); } - visitor.finalizeFile(); + visitor.insertMain(); } |
