Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Transpiler / src / main.cpp
diff options
context:
space:
mode:
1 files changed, 6 insertions, 1 deletions
-rw-r--r--Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp7
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 3efc904..4d58dc7 100644
--- a/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp
+++ b/Year 2/Implementation of Programming Languages/Transpiler/src/main.cpp
@@ -22,7 +22,12 @@ int main() {
new Integer(7),
new Name("a"),
new Name("b")
- }) })
+ }),
+ new Funcall("if", {
+ new Integer(5),
+ new Funcall("+", { new Integer(1), new Integer(2) }),
+ new Funcall("-", { new Integer(3), new Integer(4) })
+ })})
};
for (Value* n : nodes) {
n->Visit(visitor);