Search in sources :

Example 1 with RangeCommunitySetElemHalf

use of org.batfish.datamodel.routing_policy.expr.RangeCommunitySetElemHalf in project batfish by batfish.

the class CiscoControlPlaneExtractor method toCommunitySetElemHalfExpr.

private CommunitySetElemHalfExpr toCommunitySetElemHalfExpr(Rp_community_set_elem_halfContext ctx) {
    if (ctx.value != null) {
        int value = toInteger(ctx.value);
        return new LiteralCommunitySetElemHalf(value);
    } else if (ctx.var != null) {
        String var = ctx.var.getText();
        return new VarCommunitySetElemHalf(var);
    } else if (ctx.first != null) {
        int first = toInteger(ctx.first);
        int last = toInteger(ctx.last);
        SubRange range = new SubRange(first, last);
        return new RangeCommunitySetElemHalf(range);
    } else {
        throw convError(CommunitySetElem.class, ctx);
    }
}
Also used : LiteralCommunitySetElemHalf(org.batfish.datamodel.routing_policy.expr.LiteralCommunitySetElemHalf) RangeCommunitySetElemHalf(org.batfish.datamodel.routing_policy.expr.RangeCommunitySetElemHalf) SubRange(org.batfish.datamodel.SubRange) VarCommunitySetElemHalf(org.batfish.datamodel.routing_policy.expr.VarCommunitySetElemHalf)

Aggregations

SubRange (org.batfish.datamodel.SubRange)1 LiteralCommunitySetElemHalf (org.batfish.datamodel.routing_policy.expr.LiteralCommunitySetElemHalf)1 RangeCommunitySetElemHalf (org.batfish.datamodel.routing_policy.expr.RangeCommunitySetElemHalf)1 VarCommunitySetElemHalf (org.batfish.datamodel.routing_policy.expr.VarCommunitySetElemHalf)1