use of org.batfish.common.RedFlagBatfishException in project batfish by batfish.
the class CiscoControlPlaneExtractor method toInterfaceName.
private static String toInterfaceName(Interface_nameContext ctx) {
String canonicalNamePrefix = CiscoConfiguration.getCanonicalInterfaceNamePrefix(ctx.name_prefix_alpha.getText());
String name = canonicalNamePrefix;
for (Token part : ctx.name_middle_parts) {
name += part.getText();
}
if (ctx.range().range_list.size() != 1) {
throw new RedFlagBatfishException("got interface range where single interface was expected: '" + ctx.getText() + "'");
}
name += ctx.range().getText();
return name;
}
Aggregations