package de.dhbwstuttgart.strucTypes5.typeVars;

import de.dhbwstuttgart.strucTypes5.constraints.InterfaceForConstraint;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;

/**
 * Created by sebastian on 14.04.17.
 */
public class TypeVarFactory {


    private static Integer zaehler = 0;


    public static TypeVar makeTypeVar() {
        zaehler = zaehler +1;
        return  new TypeVar(zaehler.toString());
    }

    public static TypeVarInterface makeTypeVar(InterfaceForConstraint ifc) {
        return new TypeVarInterface(ifc);
    }

    public static TypeVarRefType makeTypeVar(RefTypeOrTPHOrWildcardOrGeneric refType) {
        if (refType instanceof RefType) {
           RefType refType2 = (RefType) refType;
          return new TypeVarRefType(refType2);
        }
        else {
            System.err.println("Fehler" + TypeVarFactory.class.toString());
            return null;
        }
    }





}
