diff --git a/src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java b/src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java index 2cd6206..40db5a6 100644 --- a/src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java +++ b/src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java @@ -46,10 +46,9 @@ public static void main(String... args) { TypeChecker typeChecker = new TypeChecker(); typeChecker.visitor(astRoot); - System.out.println("error"); + if (!typeChecker.thereWasAnError) { Interpreter inter = new Interpreter(); - System.out.println("no error"); inter.visit(astRoot); } // Interpreter is a class that can traverse the AST and interpret or execute the diff --git a/src/main/java/dk/aau/cs_24_sw_4_16/carl/Semantic_A/TypeChecker.java b/src/main/java/dk/aau/cs_24_sw_4_16/carl/Semantic_A/TypeChecker.java index 70b9e82..0ca5d5f 100644 --- a/src/main/java/dk/aau/cs_24_sw_4_16/carl/Semantic_A/TypeChecker.java +++ b/src/main/java/dk/aau/cs_24_sw_4_16/carl/Semantic_A/TypeChecker.java @@ -13,9 +13,6 @@ public class TypeChecker { "tileInformationStringBuilder", "setSeed")); HashMap> strucvariablesTable; HashMap structTypes; - // HashMap fTable; // function table, - // identifier(x) og node - HashMap eTable;// variable table, identifier(x) og node(int) Stack> scopes; // scope table, variable identifier(x) og node Deque activeScope;// Hvilket scope vi er i nu diff --git a/test.carl b/test.carl index 60e5da9..2c2fe94 100644 --- a/test.carl +++ b/test.carl @@ -1,10 +1,13 @@ var number:int = 20 -var haha:string = "hej" -var difficulty:int = 20 - -var array: int[3][3] - +var difficulty:int = 20 +var Goblin : enemy ={ + var difficulty : int = 1 + var health : int = 500 + var symbol : string= "O" + // var difficulty:int = 20 +} -var x: int = array[2][2] \ No newline at end of file +//var number2:int = Goblin.size() +//Goblin.health =20 \ No newline at end of file