Search in sources :

Example 1 with RoutePolicyIfStatement

use of org.batfish.representation.cisco.RoutePolicyIfStatement in project batfish by batfish.

the class CiscoControlPlaneExtractor method toRoutePolicyStatement.

private RoutePolicyIfStatement toRoutePolicyStatement(If_rp_stanzaContext ctx) {
    RoutePolicyBoolean b = toRoutePolicyBoolean(ctx.boolean_rp_stanza());
    List<RoutePolicyStatement> stmts = toRoutePolicyStatementList(ctx.rp_stanza());
    List<RoutePolicyElseIfBlock> elseIfs = new ArrayList<>();
    for (Elseif_rp_stanzaContext ectxt : ctx.elseif_rp_stanza()) {
        elseIfs.add(toRoutePolicyElseIfBlock(ectxt));
    }
    RoutePolicyElseBlock els = null;
    Else_rp_stanzaContext elctxt = ctx.else_rp_stanza();
    if (elctxt != null) {
        els = toRoutePolicyElseBlock(elctxt);
    }
    return new RoutePolicyIfStatement(b, stmts, elseIfs, els);
}
Also used : RoutePolicyElseBlock(org.batfish.representation.cisco.RoutePolicyElseBlock) RoutePolicyElseIfBlock(org.batfish.representation.cisco.RoutePolicyElseIfBlock) RoutePolicyIfStatement(org.batfish.representation.cisco.RoutePolicyIfStatement) Elseif_rp_stanzaContext(org.batfish.grammar.cisco.CiscoParser.Elseif_rp_stanzaContext) RoutePolicyBoolean(org.batfish.representation.cisco.RoutePolicyBoolean) ArrayList(java.util.ArrayList) RoutePolicyStatement(org.batfish.representation.cisco.RoutePolicyStatement) Else_rp_stanzaContext(org.batfish.grammar.cisco.CiscoParser.Else_rp_stanzaContext)

Aggregations

ArrayList (java.util.ArrayList)1 Else_rp_stanzaContext (org.batfish.grammar.cisco.CiscoParser.Else_rp_stanzaContext)1 Elseif_rp_stanzaContext (org.batfish.grammar.cisco.CiscoParser.Elseif_rp_stanzaContext)1 RoutePolicyBoolean (org.batfish.representation.cisco.RoutePolicyBoolean)1 RoutePolicyElseBlock (org.batfish.representation.cisco.RoutePolicyElseBlock)1 RoutePolicyElseIfBlock (org.batfish.representation.cisco.RoutePolicyElseIfBlock)1 RoutePolicyIfStatement (org.batfish.representation.cisco.RoutePolicyIfStatement)1 RoutePolicyStatement (org.batfish.representation.cisco.RoutePolicyStatement)1