Search in sources :

Example 1 with CommunitySetElemHalfExpr

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

the class CiscoControlPlaneExtractor method toCommunitySetElemExpr.

private CommunitySetElem toCommunitySetElemExpr(Rp_community_set_elemContext ctx) {
    if (ctx.prefix != null) {
        CommunitySetElemHalfExpr prefix = toCommunitySetElemHalfExpr(ctx.prefix);
        CommunitySetElemHalfExpr suffix = toCommunitySetElemHalfExpr(ctx.suffix);
        return new CommunitySetElem(prefix, suffix);
    } else if (ctx.community() != null) {
        long value = toLong(ctx.community());
        return new CommunitySetElem(value);
    } else {
        throw convError(CommunitySetElem.class, ctx);
    }
}
Also used : CommunitySetElem(org.batfish.datamodel.routing_policy.expr.CommunitySetElem) CommunitySetElemHalfExpr(org.batfish.datamodel.routing_policy.expr.CommunitySetElemHalfExpr)

Aggregations

CommunitySetElem (org.batfish.datamodel.routing_policy.expr.CommunitySetElem)1 CommunitySetElemHalfExpr (org.batfish.datamodel.routing_policy.expr.CommunitySetElemHalfExpr)1