continue;
// if the destination node is also in a cycle
if (c.contains(bp.getNonterminal1()) || c.contains(bp.getNonterminal2())) {
removedProductions.add(prod);
addedProductions.add(new UnitProduction(bp.getNonterminal1()));
}
}
else if (prod instanceof UnaryProduction) {
UnaryProduction up = (UnaryProduction)prod;
// only consider assertions
if (!up.getOperation().isAssertion())
continue;
// if the destination node is also in a cycle
if (c.contains(up.getNonterminal())) {
removedProductions.add(prod);
addedProductions.add(new UnitProduction(up.getNonterminal()));
}
}
}
nt.getProductions().removeAll(removedProductions);
nt.getProductions().addAll(addedProductions);