public static boolean process(final Instruction[] flow,final int start,final Processor<Instruction> processor){
  final int length=flow.length;
  boolean[] visited=new boolean[length];
  Arrays.fill(visited,false);
  final IntStack stack=new IntStack(length);
  stack.push(start);
  while (!stack.empty()) {
    ProgressManager.checkCanceled();
    final int num=stack.pop();
    final Instruction instruction=flow[num];
    if (!processor.process(instruction)) {
      return false;
    }
    for (    Instruction succ : instruction.allSucc()) {
      final int succNum=succ.num();
      if (!visited[succNum]) {
        visited[succNum]=true;
        stack.push(succNum);
      }
    }
  }
  return true;
}

public static boolean process ( final Instruction [ ] flow , final int start , final Processor < Instruction > processor ) { final int length = flow . length ; boolean [ ] visited = new boolean [ length ] ; Arrays . fill ( visited , false ) ; final IntStack stack = new IntStack ( length ) ; stack . push ( start ) ; while ( ! stack . empty ( ) ) { ProgressManager . checkCanceled ( ) ; final int num = stack . pop ( ) ; final Instruction instruction = flow [ num ] ; if ( ! processor . process ( instruction ) ) { return false ; } for ( Instruction succ : instruction . allSucc ( ) ) { final int succNum = succ . num ( ) ; if ( ! visited [ succNum ] ) { visited [ succNum ] = true ; stack . push ( succNum ) ; } } } return true ; }
process control flow graph in depth first order
