From d1da1c6eee0ac8f3b8905521907d2f5663ba15ff Mon Sep 17 00:00:00 2001 From: Jochen Seyfried Date: Fri, 28 Jun 2024 20:31:21 +0200 Subject: [PATCH] Deleted TODOs which are done --- src/main/java/abstractSyntaxTree/Class/FieldDecl.java | 1 - src/main/java/abstractSyntaxTree/Class/MethodDecl.java | 1 - src/main/java/abstractSyntaxTree/Program.java | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/abstractSyntaxTree/Class/FieldDecl.java b/src/main/java/abstractSyntaxTree/Class/FieldDecl.java index d1bba33..14d4d39 100644 --- a/src/main/java/abstractSyntaxTree/Class/FieldDecl.java +++ b/src/main/java/abstractSyntaxTree/Class/FieldDecl.java @@ -49,7 +49,6 @@ public class FieldDecl extends AbstractType implements Node { } public void codeGen(ClassWriter cw) { - //TODO: Do we have fields with initial values? --> No dont think so --> assign FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, identifier, getFieldDescriptor(), null, null); fv.visitEnd(); } diff --git a/src/main/java/abstractSyntaxTree/Class/MethodDecl.java b/src/main/java/abstractSyntaxTree/Class/MethodDecl.java index d991c86..224cb01 100644 --- a/src/main/java/abstractSyntaxTree/Class/MethodDecl.java +++ b/src/main/java/abstractSyntaxTree/Class/MethodDecl.java @@ -75,7 +75,6 @@ public class MethodDecl implements Node { mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "", "()V", false); - //TODO: Initialize the fields of the class HashMap classFields = typeContext.get(classThatContainsMethod); for (Map.Entry entry : classFields.entrySet()) { diff --git a/src/main/java/abstractSyntaxTree/Program.java b/src/main/java/abstractSyntaxTree/Program.java index 51ba338..3826a24 100644 --- a/src/main/java/abstractSyntaxTree/Program.java +++ b/src/main/java/abstractSyntaxTree/Program.java @@ -52,8 +52,7 @@ public class Program implements Node { } methodContext.put(oneClass.name, identifierAndMethod); } - //TODO: uncomment this code - /* + int mainCounter = 0; // check if main exists for(RefType oneClass : classes){ @@ -62,7 +61,6 @@ public class Program implements Node { } if(mainCounter != 1) throw new TypeCheckException("There is not 1 Main method."); - */ // typecheck each class TypeCheckResult result = new TypeCheckResult();