From 719e19e7f884509f9752ce834c33cd1f4cd90222 Mon Sep 17 00:00:00 2001 From: Jochen Seyfried Date: Thu, 20 Jun 2024 09:07:29 +0200 Subject: [PATCH] Added TODOs --- src/main/java/abstractSyntaxTree/Class/MethodDecl.java | 3 +++ .../StatementExpression/MethodCallStatementExpression.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/abstractSyntaxTree/Class/MethodDecl.java b/src/main/java/abstractSyntaxTree/Class/MethodDecl.java index 384d8a1..7235f31 100644 --- a/src/main/java/abstractSyntaxTree/Class/MethodDecl.java +++ b/src/main/java/abstractSyntaxTree/Class/MethodDecl.java @@ -48,6 +48,9 @@ public class MethodDecl implements Node { return result; } + + //TODO: Es wird kein Bytecode für Standardkonstruktoren für die Klassen generiert + //TODO: Stack computing schlägt fehl --> Reihenfolge aufruf? --> Sobald if-else / if / while drin sind? --> vllt auch schon bei MethodenDecl //Need to get the returnType of the method if it is an object // methodContext (class, (returnType, (identifier, parameter))) public void codeGen(ClassWriter cw, HashMap>> methodContext, HashMap> typeContext) throws Exception { diff --git a/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java b/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java index 4fa060c..19b31c7 100644 --- a/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java +++ b/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java @@ -60,6 +60,7 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr //Generate Bytecode for the receiver if (classThatHasTheMethodIfNotThis != null) { //TODO: classThatHasTheMethodIfNotThis must be an object --> instance of the class not the class itself + // This is not finished // Need to call codeGen so it pushes the instance onto the stack, which will be popped of //classThatHasTheMethodIfNotThis.codeGen(); @@ -87,7 +88,7 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr for (MethodDecl methodDecl : methodDecls) { if (methodDecl.name.equals(methodName)) { //Get the method descriptor - // descriptor = methodDecl.getMethodDescriptor(methodContext); + //descriptor = methodDecl.getMethodDescriptor(methodContext); } } // mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, thisClass.name, methodName, descriptor, false);