diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java b/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java new file mode 100644 index 00000000..0eba225d --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java @@ -0,0 +1,43 @@ +package de.dhbwstuttgart.typeinference.assumptions; + +import com.sun.org.apache.regexp.internal.RE; +import de.dhbwstuttgart.parser.NullToken; +import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext; +import de.dhbwstuttgart.parser.scope.GenericTypeName; +import de.dhbwstuttgart.parser.scope.JavaClassName; +import de.dhbwstuttgart.syntaxtree.ClassOrInterface; +import de.dhbwstuttgart.syntaxtree.GenericDeclarationList; +import de.dhbwstuttgart.syntaxtree.GenericTypeVar; +import de.dhbwstuttgart.syntaxtree.Method; +import de.dhbwstuttgart.syntaxtree.factory.ASTFactory; +import de.dhbwstuttgart.syntaxtree.factory.NameGenerator; +import de.dhbwstuttgart.syntaxtree.type.RefType; +import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; +import org.antlr.v4.runtime.Token; + +import java.util.ArrayList; +import java.util.List; + +public class FunNClass extends ClassOrInterface { + public FunNClass(List funNParams) { + super(0, new JavaClassName("Fun"+(funNParams.size()-1)), new ArrayList<>(), + createMethods(funNParams), new ArrayList<>(), createGenerics(funNParams), + ASTFactory.createObjectType(), true, new ArrayList<>(), new NullToken()); + + + } + + private static GenericDeclarationList createGenerics(List funNParams) { + List generics = new ArrayList<>(); + for(RefTypeOrTPHOrWildcardOrGeneric param : funNParams){ + generics.add(new GenericTypeVar(new GenericTypeName(new GenericContext( + new JavaClassName("Fun"+(funNParams.size()-1)), null), NameGenerator.makeNewName()), + new ArrayList<>(), new NullToken(), new NullToken())); + } + return new GenericDeclarationList(generics, new NullToken()); + } + + private static List createMethods(List funNParams) { + return null; + } +}