Added TODOs

This commit is contained in:
Ahmad 2024-05-09 15:43:28 +02:00
parent dea4ba1808
commit f329ad6c59
3 changed files with 19 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package de.maishai.typedast.typedclass; package de.maishai.typedast.typedclass;
import de.maishai.ast.records.MethodCall;
import de.maishai.typedast.*; import de.maishai.typedast.*;
import lombok.Data; import lombok.Data;
import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.MethodVisitor;
@ -9,10 +10,15 @@ import java.util.Map;
@Data @Data
public class TypedMethodCall implements TypedExpression, TypedStatement { public class TypedMethodCall implements TypedExpression, TypedStatement {
private TypedExpression recipient; private TypedFieldVarAccess recipient;
private List<TypedExpression> args; private List<TypedExpression> args;
private Type returnType;
@Override public TypedMethodCall convertToTypedMethodCall(MethodCall unTypedMethodCall) {
//TODO: Implement this
return null;
}
@Override
public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) { public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) {
//TODO: Implement typeCheck for MethodCall //TODO: Implement typeCheck for MethodCall
return null; return null;

View File

@ -12,6 +12,11 @@ import java.util.Map;
public class TypedNew implements TypedExpression, TypedStatement { public class TypedNew implements TypedExpression, TypedStatement {
private Type type; private Type type;
private List<TypedExpression> args; private List<TypedExpression> args;
public TypedNew convertToTypedNew(New unTypedNew) {
//TODO: Implement this
return null;
}
@Override @Override
public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) { public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) {
// new A(1, 2, 3) // new A(1, 2, 3)

View File

@ -17,6 +17,11 @@ public class TypedParameter implements TypedNode {
private String paraName; private String paraName;
private Type type; private Type type;
public TypedParameter convertToTypedParameter(Parameter unTypedParameter) {
//TODO: implement
return null;
}
@Override @Override
public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) { public Type typeCheck(Map<String, Type> localVar, Map<String, TypedClass> classes) {
if (localVar.containsKey(paraName)) { if (localVar.containsKey(paraName)) {
@ -25,6 +30,7 @@ public class TypedParameter implements TypedNode {
localVar.put(paraName, type); localVar.put(paraName, type);
return type; return type;
} }
@Override @Override
public TypedNode convertToTypedAST(Map<String, Type> localVar, Map<String, TypedClass> classes, de.maishai.ast.records.Node unTypedAST) { public TypedNode convertToTypedAST(Map<String, Type> localVar, Map<String, TypedClass> classes, de.maishai.ast.records.Node unTypedAST) {
Parameter untyped = (Parameter) unTypedAST; Parameter untyped = (Parameter) unTypedAST;