use of org.batfish.datamodel.routing_policy.expr.VarCommunitySetElemHalf 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);
}
}
Aggregations