package de.dhbwstuttgart.strucTypes5.factoryForSyntaxtree;

import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
import de.dhbwstuttgart.syntaxtree.Generic;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typecheck.GenericTypeName;
import de.dhbwstuttgart.typecheck.JavaClassName;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sebastian on 21.04.17.
 */
public class FactoryForElementes {

    public static GenericTypeVar createGeneric(String nameOfGeneric) {
        // Code der benötigt wird um ein Generic zu erstellen.
        List<RefTypeOrTPHOrWildcardOrGeneric> list = new ArrayList<>();
        GenericContext genericContext = new GenericContext(new JavaClassName("") , new String(""));
        GenericTypeName genericTypeName = new GenericTypeName(genericContext,nameOfGeneric);
        GenericTypeVar genericTypeVar = new GenericTypeVar( genericTypeName, list , new NullToken() , new NullToken());
        return genericTypeVar;
    }


    public static GenericRefType createGenericRefType(String nameOfGeneric) {
        GenericContext genericContext = new GenericContext(new JavaClassName("") , new String(""));
        GenericTypeName genericTypeName = new GenericTypeName(genericContext,nameOfGeneric);
        GenericRefType genericRefType = new GenericRefType( genericTypeName , new NullToken());
        return genericRefType;
    }








}
