Skip to content

Commit

Permalink
Yes
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlHejlesen committed May 4, 2024
1 parent 856557a commit 6320f46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public class TypeChecker {
"tileInformationStringBuilder", "setSeed"));
HashMap<String, HashMap<String, Type>> strucvariablesTable;
HashMap<String, Type> structTypes;
// HashMap<String, FunctionDefinitionNode> fTable; // function table,
// identifier(x) og node

HashMap<String, Type> eTable;// variable table, identifier(x) og node(int)
Stack<HashMap<String, Type>> scopes; // scope table, variable identifier(x) og node
Deque<Integer> activeScope;// Hvilket scope vi er i nu
Expand Down
15 changes: 9 additions & 6 deletions test.carl
Original file line number Diff line number Diff line change
@@ -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]
//var number2:int = Goblin.size()
//Goblin.health =20

0 comments on commit 6320f46

Please sign in to comment.