done = true;
for (Component c : comp.getComponents()) {
int cycles = 0;
Nonterminal max_nt = null;
Production max_prod = null;
Operation max_op = null;
// look for operation cycles in this component
for (Nonterminal n : c.getNodes()) {
for (Production p : n.getProductions()) {
CycleVisitor v = new CycleVisitor(c);
p.visitBy(n, v);
if (v.is_cycle) {
if (cycles == 0 || v.op.getPriority() > max_op.getPriority()) { // assume that the operations are different objects
max_nt = n;
max_prod = p;
max_op = v.op;
}
cycles++;