Search in sources :

Example 1 with ExplodedSet

use of org.btrplace.safeplace.spec.term.ExplodedSet in project scheduler by btrplace.

the class MyCstrSpecVisitor method visitSetInExtension.

@Override
public ExplodedSet visitSetInExtension(@NotNull CstrSpecParser.SetInExtensionContext ctx) {
    List<Term> s = new ArrayList<>();
    Type ty = null;
    for (CstrSpecParser.TermContext t : ctx.term()) {
        Term<?> tr = (Term<?>) visit(t);
        if (ty == null) {
            ty = tr.type();
        }
        assertEqualsTypes(t.getStart(), ty, tr.type());
        s.add(tr);
    }
    return new ExplodedSet(s, ty);
}
Also used : IntType(org.btrplace.safeplace.spec.type.IntType) Type(org.btrplace.safeplace.spec.type.Type) ListType(org.btrplace.safeplace.spec.type.ListType) NodeStateType(org.btrplace.safeplace.spec.type.NodeStateType) BoolType(org.btrplace.safeplace.spec.type.BoolType) StringType(org.btrplace.safeplace.spec.type.StringType) SetType(org.btrplace.safeplace.spec.type.SetType) VMStateType(org.btrplace.safeplace.spec.type.VMStateType) CstrSpecParser(org.btrplace.safeplace.spec.antlr.CstrSpecParser) ArrayList(java.util.ArrayList) ExplodedSet(org.btrplace.safeplace.spec.term.ExplodedSet) Term(org.btrplace.safeplace.spec.term.Term) ProtectedTerm(org.btrplace.safeplace.spec.term.ProtectedTerm)

Aggregations

ArrayList (java.util.ArrayList)1 CstrSpecParser (org.btrplace.safeplace.spec.antlr.CstrSpecParser)1 ExplodedSet (org.btrplace.safeplace.spec.term.ExplodedSet)1 ProtectedTerm (org.btrplace.safeplace.spec.term.ProtectedTerm)1 Term (org.btrplace.safeplace.spec.term.Term)1 BoolType (org.btrplace.safeplace.spec.type.BoolType)1 IntType (org.btrplace.safeplace.spec.type.IntType)1 ListType (org.btrplace.safeplace.spec.type.ListType)1 NodeStateType (org.btrplace.safeplace.spec.type.NodeStateType)1 SetType (org.btrplace.safeplace.spec.type.SetType)1 StringType (org.btrplace.safeplace.spec.type.StringType)1 Type (org.btrplace.safeplace.spec.type.Type)1 VMStateType (org.btrplace.safeplace.spec.type.VMStateType)1