From 9cda095a0b502beaefe5153b241e1b187c1a02e7 Mon Sep 17 00:00:00 2001 From: JonathanFleischmann Date: Sun, 23 Jun 2024 14:47:22 +0200 Subject: [PATCH] adapted to Implementation of main in TypedAST --- src/test/java/TypingTests.java | 6 +- .../AST/ASTFeatures/AST_Break.java | 1 + .../AST/ASTFeatures/AST_Class.java | 1 + .../AST/ASTFeatures/AST_ClassObjects.java | 1 + .../AST/ASTFeatures/AST_Comment.java | 1 + .../AST/ASTFeatures/AST_CompAssign.java | 1 + .../AST/ASTFeatures/AST_ComplexCalls.java | 1 + .../AST/ASTFeatures/AST_Constructor.java | 1 + .../AST/ASTFeatures/AST_Continue.java | 1 + .../AST/ASTFeatures/AST_DataTypes.java | 1 + .../AST/ASTFeatures/AST_Field.java | 1 + .../AST/ASTFeatures/AST_For.java | 1 + .../testResources/AST/ASTFeatures/AST_If.java | 1 + .../AST/ASTFeatures/AST_LogicExpr.java | 1 + .../AST/ASTFeatures/AST_Method.java | 1 + .../AST/ASTFeatures/AST_MethodCall.java | 1 + .../AST/ASTFeatures/AST_MultipleClasses.java | 2 + .../AST/ASTFeatures/AST_Operators.java | 1 + .../AST/ASTFeatures/AST_Overloaded.java | 1 + .../AST/ASTFeatures/AST_Print.java | 1 + .../AST/ASTFeatures/AST_Return.java | 1 + .../AST/ASTFeatures/AST_Unary.java | 1 + .../ASTFeatures/AST_VariableDefWithDecl.java | 1 + .../AST/ASTFeatures/AST_While.java | 1 + .../TypedASTFeatures/TypedAST_Break.java | 1 + .../TypedASTFeatures/TypedAST_Class.java | 1 + .../TypedAST_ClassObjects.java | 1 + .../TypedASTFeatures/TypedAST_Comment.java | 1 + .../TypedASTFeatures/TypedAST_CompAssign.java | 1 + .../TypedAST_ComplexCalls.java | 1 + .../TypedAST_Constructor.java | 1 + .../TypedASTFeatures/TypedAST_Continue.java | 1 + .../TypedASTFeatures/TypedAST_DataTypes.java | 1 + .../TypedASTFeatures/TypedAST_Field.java | 1 + .../TypedASTFeatures/TypedAST_For.java | 1 + .../TypedASTFeatures/TypedAST_If.java | 1 + .../TypedASTFeatures/TypedAST_LogicExpr.java | 1 + .../TypedASTFeatures/TypedAST_Main.java | 58 ++++++++++++------- .../TypedASTFeatures/TypedAST_Method.java | 1 + .../TypedASTFeatures/TypedAST_MethodCall.java | 1 + .../TypedAST_MultipleClasses.java | 2 + .../TypedASTFeatures/TypedAST_Operators.java | 1 + .../TypedASTFeatures/TypedAST_Overloaded.java | 1 + .../TypedASTFeatures/TypedAST_Print.java | 1 + .../TypedASTFeatures/TypedAST_Return.java | 1 + .../TypedASTFeatures/TypedAST_Unary.java | 1 + .../TypedAST_VariableDefWithDecl.java | 1 + .../TypedASTFeatures/TypedAST_While.java | 1 + ...edAbstractSyntax_ClassWithConstructor.java | 1 + .../TypedAbstractSyntax_ClassWithField.java | 1 + .../TypedAbstractSyntax_ComplexClass.java | 1 + .../TypedAbstractSyntax_PublicClass.java | 1 + 52 files changed, 90 insertions(+), 26 deletions(-) diff --git a/src/test/java/TypingTests.java b/src/test/java/TypingTests.java index 2f8ae66..fd8663f 100644 --- a/src/test/java/TypingTests.java +++ b/src/test/java/TypingTests.java @@ -127,12 +127,8 @@ public class TypingTests { public void testMain() { TypedProgram resultTypedAst = Compiler.generateTypedASTFromAst(AST_Main.get()); assertEquals(TypedAST_Main.get(), resultTypedAst); - try { - throw new ExecutionControl.NotImplementedException("Main Class not yet implemented in TypedAST"); - } catch (ExecutionControl.NotImplementedException e) { - throw new RuntimeException(e); - } } + // TODO: Wie soll das Resultat aussehen? Soll tatsächlich main auch als Methode aufgeführt werden? @Test public void testMethod() { diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Break.java b/src/test/java/testResources/AST/ASTFeatures/AST_Break.java index 164ff37..8f18b93 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Break.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Break.java @@ -13,6 +13,7 @@ public class AST_Break { List.of( new Class( "Break", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Class.java b/src/test/java/testResources/AST/ASTFeatures/AST_Class.java index 642a608..fb6ffdf 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Class.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Class.java @@ -13,6 +13,7 @@ public class AST_Class { List.of( new Class( "Class", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_ClassObjects.java b/src/test/java/testResources/AST/ASTFeatures/AST_ClassObjects.java index 0883666..5ff2432 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_ClassObjects.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_ClassObjects.java @@ -12,6 +12,7 @@ public class AST_ClassObjects { List.of( new Class( "ClassObjects", + null, List.of( new Declaration( "b", diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Comment.java b/src/test/java/testResources/AST/ASTFeatures/AST_Comment.java index 6edcf40..776f871 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Comment.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Comment.java @@ -13,6 +13,7 @@ public class AST_Comment { List.of( new Class( "Comment", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_CompAssign.java b/src/test/java/testResources/AST/ASTFeatures/AST_CompAssign.java index b514a1e..600d036 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_CompAssign.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_CompAssign.java @@ -13,6 +13,7 @@ public class AST_CompAssign { List.of( new Class( "CompAssign", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_ComplexCalls.java b/src/test/java/testResources/AST/ASTFeatures/AST_ComplexCalls.java index cd5a196..62e0aee 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_ComplexCalls.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_ComplexCalls.java @@ -12,6 +12,7 @@ public class AST_ComplexCalls { List.of( new Class( "ComplexCalls", + null, List.of( new Declaration( "classObject", diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Constructor.java b/src/test/java/testResources/AST/ASTFeatures/AST_Constructor.java index 3c7e3c9..c66dd4e 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Constructor.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Constructor.java @@ -14,6 +14,7 @@ public class AST_Constructor { List.of( new Class( "Constructor", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Continue.java b/src/test/java/testResources/AST/ASTFeatures/AST_Continue.java index 38afc3a..3054053 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Continue.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Continue.java @@ -13,6 +13,7 @@ public class AST_Continue { List.of( new Class( "Continue", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_DataTypes.java b/src/test/java/testResources/AST/ASTFeatures/AST_DataTypes.java index 9e432d6..b028e36 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_DataTypes.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_DataTypes.java @@ -13,6 +13,7 @@ public class AST_DataTypes { List.of( new Class( "DataTypes", + null, List.of( new Declaration( "x", diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Field.java b/src/test/java/testResources/AST/ASTFeatures/AST_Field.java index 26cdda2..456d02a 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Field.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Field.java @@ -12,6 +12,7 @@ public class AST_Field { List.of( new Class( "Field", + null, List.of( new Declaration( "x", diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_For.java b/src/test/java/testResources/AST/ASTFeatures/AST_For.java index 2cb9768..db2727b 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_For.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_For.java @@ -13,6 +13,7 @@ public class AST_For { List.of( new Class( "For", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_If.java b/src/test/java/testResources/AST/ASTFeatures/AST_If.java index 664a695..5e27830 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_If.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_If.java @@ -12,6 +12,7 @@ public class AST_If { List.of( new Class( "If", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_LogicExpr.java b/src/test/java/testResources/AST/ASTFeatures/AST_LogicExpr.java index a90a874..6e2bf48 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_LogicExpr.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_LogicExpr.java @@ -13,6 +13,7 @@ public class AST_LogicExpr { List.of( new Class( "LogicExpr", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Method.java b/src/test/java/testResources/AST/ASTFeatures/AST_Method.java index 3bbb6f1..f0ba279 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Method.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Method.java @@ -12,6 +12,7 @@ public class AST_Method { List.of( new Class( "Method", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_MethodCall.java b/src/test/java/testResources/AST/ASTFeatures/AST_MethodCall.java index 761e2e4..b7757cc 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_MethodCall.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_MethodCall.java @@ -13,6 +13,7 @@ public class AST_MethodCall { List.of( new Class( "MethodCall", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_MultipleClasses.java b/src/test/java/testResources/AST/ASTFeatures/AST_MultipleClasses.java index ac43d70..6a6a309 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_MultipleClasses.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_MultipleClasses.java @@ -12,6 +12,7 @@ public class AST_MultipleClasses { List.of( new Class( "MultipleClasses", + null, List.of( new Declaration( "anotherClass", @@ -43,6 +44,7 @@ public class AST_MultipleClasses { ), new Class( "AnotherClass", + null, List.of( new Declaration( "multipleClasses", diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Operators.java b/src/test/java/testResources/AST/ASTFeatures/AST_Operators.java index 3274485..33a70de 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Operators.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Operators.java @@ -14,6 +14,7 @@ public class AST_Operators { List.of( new Class( "Operators", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Overloaded.java b/src/test/java/testResources/AST/ASTFeatures/AST_Overloaded.java index cacbb80..93ab77e 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Overloaded.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Overloaded.java @@ -13,6 +13,7 @@ public class AST_Overloaded { List.of( new Class( "Overloaded", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Print.java b/src/test/java/testResources/AST/ASTFeatures/AST_Print.java index 713df3b..ce2dc90 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Print.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Print.java @@ -13,6 +13,7 @@ public class AST_Print { List.of( new Class( "Print", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Return.java b/src/test/java/testResources/AST/ASTFeatures/AST_Return.java index 214dff0..6403cda 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Return.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Return.java @@ -12,6 +12,7 @@ public class AST_Return { List.of( new Class( "Return", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_Unary.java b/src/test/java/testResources/AST/ASTFeatures/AST_Unary.java index dc3a1e3..628949f 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_Unary.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_Unary.java @@ -13,6 +13,7 @@ public class AST_Unary { List.of( new Class( "Unary", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_VariableDefWithDecl.java b/src/test/java/testResources/AST/ASTFeatures/AST_VariableDefWithDecl.java index 546ec84..8f38db8 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_VariableDefWithDecl.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_VariableDefWithDecl.java @@ -12,6 +12,7 @@ public class AST_VariableDefWithDecl { List.of( new Class( "VariableDefWithDecl", + null, List.of(), List.of(), List.of( diff --git a/src/test/java/testResources/AST/ASTFeatures/AST_While.java b/src/test/java/testResources/AST/ASTFeatures/AST_While.java index 39fcab2..6a10695 100644 --- a/src/test/java/testResources/AST/ASTFeatures/AST_While.java +++ b/src/test/java/testResources/AST/ASTFeatures/AST_While.java @@ -13,6 +13,7 @@ public class AST_While { List.of( new Class( "While", + null, List.of(), List.of( new Method( diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Break.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Break.java index 97d0e28..d0a83d2 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Break.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Break.java @@ -135,6 +135,7 @@ public class TypedAST_Break { ), null, null, + null, Type.REFERENCE("Break") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Class.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Class.java index 00c3211..73e07ad 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Class.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Class.java @@ -31,6 +31,7 @@ public class TypedAST_Class { ), null, null, + null, Type.REFERENCE("Class") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ClassObjects.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ClassObjects.java index 80689d6..91a4ea3 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ClassObjects.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ClassObjects.java @@ -117,6 +117,7 @@ public class TypedAST_ClassObjects { ), null, null, + null, Type.REFERENCE("ClassObjects") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Comment.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Comment.java index 95a050e..7c8665c 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Comment.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Comment.java @@ -31,6 +31,7 @@ public class TypedAST_Comment { ), null, null, + null, Type.REFERENCE("Comment") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_CompAssign.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_CompAssign.java index 3990100..1016a3d 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_CompAssign.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_CompAssign.java @@ -275,6 +275,7 @@ public class TypedAST_CompAssign { ), null, null, + null, Type.REFERENCE("CompAssign") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ComplexCalls.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ComplexCalls.java index 0aa5407..8d31d91 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ComplexCalls.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_ComplexCalls.java @@ -229,6 +229,7 @@ public class TypedAST_ComplexCalls { ), null, null, + null, Type.REFERENCE("ComplexCalls") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Constructor.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Constructor.java index e102bd5..6d0d63a 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Constructor.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Constructor.java @@ -149,6 +149,7 @@ public class TypedAST_Constructor { ), null, null, + null, Type.REFERENCE("Constructor") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Continue.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Continue.java index efe4e02..1e2e7fe 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Continue.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Continue.java @@ -136,6 +136,7 @@ public class TypedAST_Continue { ), null, null, + null, Type.REFERENCE("Continue") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_DataTypes.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_DataTypes.java index fa0fa01..00b0b9d 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_DataTypes.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_DataTypes.java @@ -174,6 +174,7 @@ public class TypedAST_DataTypes { ), null, null, + null, Type.REFERENCE("DataTypes") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Field.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Field.java index c6a182a..9e22b76 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Field.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Field.java @@ -76,6 +76,7 @@ public class TypedAST_Field { ), null, null, + null, Type.REFERENCE("Field") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_For.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_For.java index ba72415..a2b5885 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_For.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_For.java @@ -166,6 +166,7 @@ public class TypedAST_For { ), null, null, + null, Type.REFERENCE("For") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_If.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_If.java index 6ae9eaf..60c75cc 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_If.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_If.java @@ -78,6 +78,7 @@ public class TypedAST_If { ), null, null, + null, Type.REFERENCE("If") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_LogicExpr.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_LogicExpr.java index d6e256e..6ecb0f9 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_LogicExpr.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_LogicExpr.java @@ -558,6 +558,7 @@ public class TypedAST_LogicExpr { ), null, null, + null, Type.REFERENCE("LogicExpr") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Main.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Main.java index c0bd740..76e3aae 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Main.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Main.java @@ -1,10 +1,7 @@ package testResources.TypedAST.TypedASTFeatures; + import de.maishai.typedast.Type; -import de.maishai.typedast.typedclass.TypedBlock; -import de.maishai.typedast.typedclass.TypedClass; -import de.maishai.typedast.typedclass.TypedConstructor; -import de.maishai.typedast.typedclass.TypedProgram; -import jdk.jshell.spi.ExecutionControl; +import de.maishai.typedast.typedclass.*; import java.util.List; @@ -14,22 +11,6 @@ public class TypedAST_Main { List.of( new TypedClass( "Main", -// new Block( -// List.of( -// new Declaration( -// "i", -// Type.INT -// ), -// new Assignment( -// new FieldVarAccess( -// false, -// null, -// "i" -// ), -// new IntLiteral(0) -// ) -// ) -// ), List.of(), List.of(), List.of( @@ -45,6 +26,41 @@ public class TypedAST_Main { List.of() ) ), + new TypedMain( + Type.VOID, + new TypedMethod( + "main", + Type.VOID, + List.of(), + List.of(), + new TypedBlock( + List.of( + new TypedLocalVariable( + "i", + Type.INT + ) + ), + List.of( + new TypedAssignment( + new TypedIntLiteral( + 0, + Type.INT + ), + new TypedFieldVarAccess( + false, + null, + "i", + Type.INT + ), + Type.INT + ) + ), + Type.VOID + ) + + ) + + ), null, null, Type.REFERENCE("Main") diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Method.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Method.java index 46b5f61..60e0f30 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Method.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Method.java @@ -40,6 +40,7 @@ public class TypedAST_Method { ), null, null, + null, Type.REFERENCE("Method") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MethodCall.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MethodCall.java index 02805d5..94b5271 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MethodCall.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MethodCall.java @@ -204,6 +204,7 @@ public class TypedAST_MethodCall { ), null, null, + null, Type.REFERENCE("MethodCall") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MultipleClasses.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MultipleClasses.java index 3d2b1aa..68f9a6d 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MultipleClasses.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_MultipleClasses.java @@ -47,6 +47,7 @@ public class TypedAST_MultipleClasses { ), null, null, + null, Type.REFERENCE("MultipleClasses") ), new TypedClass( @@ -87,6 +88,7 @@ public class TypedAST_MultipleClasses { ), null, null, + null, Type.REFERENCE("AnotherClass") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Operators.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Operators.java index 2b33b30..ad1f463 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Operators.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Operators.java @@ -437,6 +437,7 @@ public class TypedAST_Operators { ), null, null, + null, Type.REFERENCE("Operators") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Overloaded.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Overloaded.java index c66fb78..15a4317 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Overloaded.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Overloaded.java @@ -115,6 +115,7 @@ public class TypedAST_Overloaded { ), null, null, + null, Type.REFERENCE("Overloaded") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Print.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Print.java index 718f0a0..d240acb 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Print.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Print.java @@ -96,6 +96,7 @@ public class TypedAST_Print { ), null, null, + null, Type.REFERENCE("Print") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Return.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Return.java index 592b74d..451d8fd 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Return.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Return.java @@ -122,6 +122,7 @@ public class TypedAST_Return { ), null, null, + null, Type.REFERENCE("Return") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Unary.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Unary.java index 9285384..1df5875 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Unary.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_Unary.java @@ -95,6 +95,7 @@ public class TypedAST_Unary { ), null, null, + null, Type.REFERENCE("Unary") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_VariableDefWithDecl.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_VariableDefWithDecl.java index a2e33fe..96a975a 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_VariableDefWithDecl.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_VariableDefWithDecl.java @@ -66,6 +66,7 @@ public class TypedAST_VariableDefWithDecl { ), null, null, + null, Type.REFERENCE("VariableDefWithDecl") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_While.java b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_While.java index 7624e5c..551433a 100644 --- a/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_While.java +++ b/src/test/java/testResources/TypedAST/TypedASTFeatures/TypedAST_While.java @@ -182,6 +182,7 @@ public class TypedAST_While { ), null, null, + null, Type.REFERENCE("While") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithConstructor.java b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithConstructor.java index b8236de..e0d701c 100644 --- a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithConstructor.java +++ b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithConstructor.java @@ -35,6 +35,7 @@ public class TypedAbstractSyntax_ClassWithConstructor { getConstructors(), null, null, + null, Type.REFERENCE("ClassWithConstructor") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithField.java b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithField.java index 9a95d6b..d2513d9 100644 --- a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithField.java +++ b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ClassWithField.java @@ -36,6 +36,7 @@ public class TypedAbstractSyntax_ClassWithField { ), null, null, + null, Type.REFERENCE("ClassWithField") ) ), diff --git a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ComplexClass.java b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ComplexClass.java index 40fb554..34179bf 100644 --- a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ComplexClass.java +++ b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_ComplexClass.java @@ -118,6 +118,7 @@ public class TypedAbstractSyntax_ComplexClass { getConstructors(), null, null, + null, Type.REFERENCE("ComplexClass") ); } diff --git a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_PublicClass.java b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_PublicClass.java index 31b5d85..5bb81e5 100644 --- a/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_PublicClass.java +++ b/src/test/java/testResources/TypedAST/TypedASTMore/TypedAbstractSyntax_PublicClass.java @@ -29,6 +29,7 @@ public class TypedAbstractSyntax_PublicClass { ), null, null, + null, Type.REFERENCE("PublicClass") ) ),