diff --git a/src/main/java/de/hsrm/compiler/Klang/Klang.java b/src/main/java/de/hsrm/compiler/Klang/Klang.java index 8b63cd1..17a5dec 100644 --- a/src/main/java/de/hsrm/compiler/Klang/Klang.java +++ b/src/main/java/de/hsrm/compiler/Klang/Klang.java @@ -87,6 +87,7 @@ public class Klang { // Context Analysis and DAST generation Node root; + HashMap structs; try { // Extract information about all functions var functionDefinitions = new HashMap(); @@ -97,7 +98,7 @@ public class Klang { new GetStructNames(structNames).visit(tree); // Extract information about all structs - var structs = new HashMap(); + structs = new HashMap(); new GetStructs(structNames, structs).visit(tree); // Create the DAST @@ -120,7 +121,7 @@ public class Klang { if (evaluate) { // Evaluate the sourcecode and print the result System.out.println("\nEvaluating the source code:"); - EvalVisitor evalVisitor = new EvalVisitor(); + EvalVisitor evalVisitor = new EvalVisitor(structs); Value result = root.welcome(evalVisitor); generateOutput(out, "Result was: " + result.asObject().toString()); return;