Added TODOs

This commit is contained in:
Jochen Seyfried 2024-06-20 09:07:29 +02:00
parent 5220a65a92
commit 719e19e7f8
2 changed files with 5 additions and 1 deletions

View File

@ -48,6 +48,9 @@ public class MethodDecl implements Node {
return result; 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 //Need to get the returnType of the method if it is an object
// methodContext (class, (returnType, (identifier, parameter))) // methodContext (class, (returnType, (identifier, parameter)))
public void codeGen(ClassWriter cw, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception { public void codeGen(ClassWriter cw, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {

View File

@ -60,6 +60,7 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr
//Generate Bytecode for the receiver //Generate Bytecode for the receiver
if (classThatHasTheMethodIfNotThis != null) { if (classThatHasTheMethodIfNotThis != null) {
//TODO: classThatHasTheMethodIfNotThis must be an object --> instance of the class not the class itself //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 // Need to call codeGen so it pushes the instance onto the stack, which will be popped of
//classThatHasTheMethodIfNotThis.codeGen(); //classThatHasTheMethodIfNotThis.codeGen();
@ -87,7 +88,7 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr
for (MethodDecl methodDecl : methodDecls) { for (MethodDecl methodDecl : methodDecls) {
if (methodDecl.name.equals(methodName)) { if (methodDecl.name.equals(methodName)) {
//Get the method descriptor //Get the method descriptor
// descriptor = methodDecl.getMethodDescriptor(methodContext); //descriptor = methodDecl.getMethodDescriptor(methodContext);
} }
} }
// mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, thisClass.name, methodName, descriptor, false); // mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, thisClass.name, methodName, descriptor, false);