public void indexNode(CommonTree node,List<CompilationUnit> list){
  if (node == null) {
    return;
  }
  if (node instanceof DelphiPMDNode) {
    list.add((DelphiPMDNode)node);
  }
 else {
    list.add(new DelphiPMDNode(node));
  }
  for (int i=0; i < node.getChildCount(); ++i) {
    indexNode((CommonTree)node.getChild(i),list);
  }
}

public void indexNode ( CommonTree node , List < CompilationUnit > list ) { if ( node == null ) { return ; } if ( node instanceof DelphiPMDNode ) { list . add ( ( DelphiPMDNode ) node ) ; } else { list . add ( new DelphiPMDNode ( node ) ) ; } for ( int i = 0 ; i < node . getChildCount ( ) ; ++ i ) { indexNode ( ( CommonTree ) node . getChild ( i ) , list ) ; } }
adds children nodes to list
