Search in sources :

Example 11 with RecordType

use of jkind.lustre.RecordType in project AGREE by loonwerks.

the class AgreeUtils method getLustreTypes.

public static List<TypeDef> getLustreTypes(AgreeProgram agreeProgram) {
    List<TypeDef> types = new ArrayList<>();
    for (Type type : agreeProgram.globalTypes) {
        String typeName;
        if (type instanceof RecordType) {
            typeName = ((RecordType) type).id;
        } else if (type instanceof EnumType) {
            typeName = ((EnumType) type).id;
        } else {
            throw new AgreeException("Unable to handle type of type '" + type.getClass() + "'");
        }
        types.add(new TypeDef(typeName, type));
    }
    // add synonym types
    types.addAll(getTypeSynonmyms());
    return types;
}
Also used : RecordType(jkind.lustre.RecordType) EnumType(jkind.lustre.EnumType) ComponentType(org.osate.aadl2.ComponentType) Type(jkind.lustre.Type) NamedType(jkind.lustre.NamedType) TypeDef(jkind.lustre.TypeDef) RecordType(jkind.lustre.RecordType) EnumType(jkind.lustre.EnumType) ArrayList(java.util.ArrayList)

Aggregations

RecordType (jkind.lustre.RecordType)11 Type (jkind.lustre.Type)9 NamedType (jkind.lustre.NamedType)8 ArrayList (java.util.ArrayList)5 EnumType (jkind.lustre.EnumType)5 Expr (jkind.lustre.Expr)5 RecordAccessExpr (jkind.lustre.RecordAccessExpr)5 Entry (java.util.Map.Entry)4 ArrayType (jkind.lustre.ArrayType)3 BinaryExpr (jkind.lustre.BinaryExpr)3 BoolExpr (jkind.lustre.BoolExpr)3 IdExpr (jkind.lustre.IdExpr)3 AgreeNode (com.rockwellcollins.atc.agree.analysis.ast.AgreeNode)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ArrayAccessExpr (jkind.lustre.ArrayAccessExpr)2 IntExpr (jkind.lustre.IntExpr)2 Node (jkind.lustre.Node)2 NodeCallExpr (jkind.lustre.NodeCallExpr)2 RecordExpr (jkind.lustre.RecordExpr)2