NichtHaskell/Source/abstractSyntaxTree/Class/MethodDecl.java

36 lines
1.0 KiB
Java
Raw Normal View History

package abstractSyntaxTree.Class;
2024-05-08 08:10:44 +00:00
import TypeCheck.TypeCheckResult;
2024-05-08 09:22:12 +00:00
import abstractSyntaxTree.Program;
import org.objectweb.asm.ClassWriter;
2024-05-08 08:10:44 +00:00
2024-05-08 09:22:12 +00:00
import java.util.HashMap;
2024-05-08 08:10:44 +00:00
import java.util.List;
public class MethodDecl implements IClass {
2024-05-08 09:22:12 +00:00
2024-05-08 11:51:00 +00:00
// name
2024-05-08 10:48:56 +00:00
private HashMap<String, HashMap<String, HashMap<String, String>>> methodContext;
private HashMap<String, HashMap<String, String>> typeContext;
2024-05-08 09:22:12 +00:00
2024-05-08 11:51:20 +00:00
//TODO: Move this into the typeCheck
2024-05-08 10:48:56 +00:00
private HashMap<String, String> localVars; // (type, identifier) // add content here
2024-05-08 09:22:12 +00:00
2024-05-08 10:48:56 +00:00
public MethodDecl(HashMap<String, HashMap<String, HashMap<String, String>>> methodContext, HashMap<String, HashMap<String, String>> typeContext){
this.methodContext = methodContext;
this.typeContext = typeContext;
2024-05-08 09:22:12 +00:00
}
2024-05-08 08:10:44 +00:00
public TypeCheckResult typeCheck(List<MethodDecl> fieldsOrMethods) throws Exception {
2024-05-08 10:48:56 +00:00
// write localvars
// jede methode als block statement aufrufen
2024-05-08 08:10:44 +00:00
return null;
}
@Override
public void codeGen(ClassWriter cw) {
}
}