Search in sources :

Example 1 with ParametricDataTypeDecl

use of abs.frontend.ast.ParametricDataTypeDecl in project abstools by abstools.

the class PureExpressionBuilder method importType.

void importType(Decl decl) {
    importModules.add(decl.getModuleDecl().getName());
    if (decl instanceof TypeSynDecl) {
        decl = resolveTypeSynonym((TypeSynDecl) decl);
        importModules.add(decl.getModuleDecl().getName());
    }
    // import type parameters
    if (decl instanceof ParametricDataTypeDecl) {
        for (TypeParameterDecl t : ((ParametricDataTypeDecl) decl).getTypeParameters()) {
            Decl type = getDecl(model, Decl.class, namePred(t.getName()));
            if (type == null) {
                // most likely a generic type
                continue;
            }
            importType(type);
        }
    }
}
Also used : TypeParameterDecl(abs.frontend.ast.TypeParameterDecl) AbsASTBuilderUtil.getDecl(abs.backend.tests.AbsASTBuilderUtil.getDecl) DataTypeDecl(abs.frontend.ast.DataTypeDecl) InterfaceDecl(abs.frontend.ast.InterfaceDecl) Decl(abs.frontend.ast.Decl) TypeParameterDecl(abs.frontend.ast.TypeParameterDecl) TypeSynDecl(abs.frontend.ast.TypeSynDecl) ParametricDataTypeDecl(abs.frontend.ast.ParametricDataTypeDecl) ParametricDataTypeDecl(abs.frontend.ast.ParametricDataTypeDecl) TypeSynDecl(abs.frontend.ast.TypeSynDecl)

Aggregations

AbsASTBuilderUtil.getDecl (abs.backend.tests.AbsASTBuilderUtil.getDecl)1 DataTypeDecl (abs.frontend.ast.DataTypeDecl)1 Decl (abs.frontend.ast.Decl)1 InterfaceDecl (abs.frontend.ast.InterfaceDecl)1 ParametricDataTypeDecl (abs.frontend.ast.ParametricDataTypeDecl)1 TypeParameterDecl (abs.frontend.ast.TypeParameterDecl)1 TypeSynDecl (abs.frontend.ast.TypeSynDecl)1