code: public void scan(List<? extends JCTree> trees) {
          if (trees != null)
          for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
              scan(l.head);
      }
  
  
  /* ***************************************************************************
   * Visitor methods
   ****************************************************************************/
  
      public void visitTopLevel(JCCompilationUnit tree) {
          scan(tree.packageAnnotations);
          scan(tree.pid);
          scan(tree.defs);
      }
  
      public void visitImport(JCImport tree) {
          scan(tree.qualid);
      }
  
      public void visitClassDef(JCClassDecl tree) {
          scan(tree.mods);
          scan(tree.typarams);
          scan(tree.extending);
          scan(tree.implementing);
          scan(tree.defs);
      }
  
      public void visitMethodDef(JCMethodDecl tree) {
          scan(tree.mods);
          scan(tree.restype);
          scan(tree.typarams);
          scan(tree.recvparam);
          scan(tree.params);
          scan(tree.thrown);
          scan(tree.defaultValue);
          scan(tree.body);
      }
  
      public void visitVarDef(JCVariableDecl tree) {
          scan(tree.mods);
          scan(tree.vartype);
          scan(tree.nameexpr);
          scan(tree.init);
      }
  
      public void visitSkip(JCSkip tree) {
      }
docs: Visitor method: scan a list of nodes.