use of org.batfish.grammar.flatjuniper.FlatJuniperParser.As_unitContext in project batfish by batfish.
the class ConfigurationBuilder method toAsPath.
private AsPath toAsPath(As_path_exprContext path) {
List<SortedSet<Integer>> asPath = new ArrayList<>();
for (As_unitContext ctx : path.items) {
SortedSet<Integer> asSet = new TreeSet<>();
if (ctx.DEC() != null) {
asSet.add(toInt(ctx.DEC()));
} else {
for (Token token : ctx.as_set().items) {
asSet.add(toInt(token));
}
}
asPath.add(asSet);
}
return new AsPath(asPath);
}
Aggregations