Search in sources :

Example 1 with ListBuilder

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

the class MyCstrSpecVisitor method visitListInComprehension.

@Override
public ListBuilder<?> visitListInComprehension(@NotNull CstrSpecParser.ListInComprehensionContext ctx) {
    // Get the binder
    List<UserVar<?>> v = visitTypedef(ctx.typedef());
    Proposition p = Proposition.True;
    if (ctx.COMMA() != null) {
        p = (Proposition) visit(ctx.formula());
    }
    Term<?> t = (Term<?>) visit(ctx.term());
    return new ListBuilder<>(t, v.get(0), p);
}
Also used : ListBuilder(org.btrplace.safeplace.spec.term.ListBuilder) Term(org.btrplace.safeplace.spec.term.Term) ProtectedTerm(org.btrplace.safeplace.spec.term.ProtectedTerm) Proposition(org.btrplace.safeplace.spec.prop.Proposition) ProtectedProposition(org.btrplace.safeplace.spec.prop.ProtectedProposition) UserVar(org.btrplace.safeplace.spec.term.UserVar)

Aggregations

Proposition (org.btrplace.safeplace.spec.prop.Proposition)1 ProtectedProposition (org.btrplace.safeplace.spec.prop.ProtectedProposition)1 ListBuilder (org.btrplace.safeplace.spec.term.ListBuilder)1 ProtectedTerm (org.btrplace.safeplace.spec.term.ProtectedTerm)1 Term (org.btrplace.safeplace.spec.term.Term)1 UserVar (org.btrplace.safeplace.spec.term.UserVar)1