private void trace(VarNode node,PrintStream ps,HashSet<Node> visitedNodes,int level){
  if (level < 1)   return;
  ps.println("\t" + translateLabel(node));
  Node[] succs=pag.simpleInvLookup(node);
  for (int i=0; i < succs.length; i++) {
    if (visitedNodes.contains(succs[i]))     continue;
    ps.println("\t" + translateLabel(succs[i]));
    ps.println("\t" + translateEdge(node,succs[i],"assign"));
    visitedNodes.add(succs[i]);
    trace((VarNode)succs[i],ps,visitedNodes,level - 1);
  }
  succs=pag.allocInvLookup(node);
  for (int i=0; i < succs.length; i++) {
    if (visitedNodes.contains(succs[i]))     continue;
    ps.println("\t" + translateLabel(succs[i]));
    ps.println("\t" + translateEdge(node,succs[i],"new"));
  }
  succs=vmatches.get(node);
  if (succs != null) {
    for (int i=0; i < succs.length; i++) {
      if (visitedNodes.contains(succs[i]))       continue;
      ps.println("\t" + translateLabel(succs[i]));
      ps.println("\t" + translateEdge(node,succs[i],"vmatch"));
      trace((VarNode)succs[i],ps,visitedNodes,level - 1);
    }
  }
}

private void trace ( VarNode node , PrintStream ps , HashSet < Node > visitedNodes , int level ) { if ( level < 1 ) return ; ps . println ( "\t" + translateLabel ( node ) ) ; Node [ ] succs = pag . simpleInvLookup ( node ) ; for ( int i = 0 ; i < succs . length ; i ++ ) { if ( visitedNodes . contains ( succs [ i ] ) ) continue ; ps . println ( "\t" + translateLabel ( succs [ i ] ) ) ; ps . println ( "\t" + translateEdge ( node , succs [ i ] , "assign" ) ) ; visitedNodes . add ( succs [ i ] ) ; trace ( ( VarNode ) succs [ i ] , ps , visitedNodes , level - 1 ) ; } succs = pag . allocInvLookup ( node ) ; for ( int i = 0 ; i < succs . length ; i ++ ) { if ( visitedNodes . contains ( succs [ i ] ) ) continue ; ps . println ( "\t" + translateLabel ( succs [ i ] ) ) ; ps . println ( "\t" + translateEdge ( node , succs [ i ] , "new" ) ) ; } succs = vmatches . get ( node ) ; if ( succs != null ) { for ( int i = 0 ; i < succs . length ; i ++ ) { if ( visitedNodes . contains ( succs [ i ] ) ) continue ; ps . println ( "\t" + translateLabel ( succs [ i ] ) ) ; ps . println ( "\t" + translateEdge ( node , succs [ i ] , "vmatch" ) ) ; trace ( ( VarNode ) succs [ i ] , ps , visitedNodes , level - 1 ) ; } } }
do a dfs traversal
