2024-05-02 11:12:39 +00:00
|
|
|
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;
|
2024-05-08 12:15:11 +00:00
|
|
|
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;
|
|
|
|
|
2024-05-02 11:12:39 +00:00
|
|
|
public class MethodDecl implements IClass {
|
2024-05-08 09:22:12 +00:00
|
|
|
|
2024-05-08 12:28:51 +00:00
|
|
|
public String classThatContainsMethod;
|
|
|
|
public String name;
|
|
|
|
public List<String> parameters;
|
|
|
|
public String returnType;
|
2024-05-08 11:51:00 +00:00
|
|
|
|
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-09 12:20:55 +00:00
|
|
|
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, List<MethodDecl> fieldsOrMethods) throws Exception {
|
2024-05-08 10:48:56 +00:00
|
|
|
// write localvars
|
|
|
|
|
2024-05-08 12:28:51 +00:00
|
|
|
|
2024-05-08 10:48:56 +00:00
|
|
|
// jede methode als block statement aufrufen
|
2024-05-08 08:10:44 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2024-05-08 12:42:56 +00:00
|
|
|
@Override
|
|
|
|
public void codeGen(ClassWriter cw) throws Exception {
|
|
|
|
|
|
|
|
}
|
2024-05-02 11:12:39 +00:00
|
|
|
}
|