Visits this node and all child nodes depth-first, calling the provided visitor's visit methods.
971434
public void traverse(JavacASTVisitor visitor) {
		switch (this.getKind()) {
		case COMPILATION_UNIT:
			visitor.visitCompilationUnit(this, (JCCompilationUnit) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitCompilationUnit(this, (JCCompilationUnit) get());
			break;
		case TYPE:
			visitor.visitType(this, (JCClassDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitType(this, (JCClassDecl) get());
			break;
		case FIELD:
			visitor.visitField(this, (JCVariableDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitField(this, (JCVariableDecl) get());
			break;
		case METHOD:
			visitor.visitMethod(this, (JCMethodDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitMethod(this, (JCMethodDecl) get());
			break;
		case INITIALIZER:
			visitor.visitInitializer(this, (JCBlock) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitInitializer(this, (JCBlock) get());
			break;
		case ARGUMENT:
			JCMethodDecl parentMethod = (JCMethodDecl) up().get();
			visitor.visitMethodArgument(this, (JCVariableDecl) get(), parentMethod);
			ast.traverseChildren(visitor, this);
			visitor.endVisitMethodArgument(this, (JCVariableDecl) get(), parentMethod);
			break;
		case LOCAL:
			visitor.visitLocal(this, (JCVariableDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitLocal(this, (JCVariableDecl) get());
			break;
		case STATEMENT:
			visitor.visitStatement(this, get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitStatement(this, get());
			break;
		case ANNOTATION:
			switch (up().getKind()) {
			case TYPE:
				visitor.visitAnnotationOnType((JCClassDecl) up().get(), this, (JCAnnotation) get());
				break;
			case FIELD:
				visitor.visitAnnotationOnField((JCVariableDecl) up().get(), this, (JCAnnotation) get());
				break;
			case METHOD:
				visitor.visitAnnotationOnMethod((JCMethodDecl) up().get(), this, (JCAnnotation) get());
				break;
			case ARGUMENT:
				JCVariableDecl argument = (JCVariableDecl) up().get();
				JCMethodDecl method = (JCMethodDecl) up().up().get();
				visitor.visitAnnotationOnMethodArgument(argument, method, this, (JCAnnotation) get());
				break;
			case LOCAL:
				visitor.visitAnnotationOnLocal((JCVariableDecl) up().get(), this, (JCAnnotation) get());
				break;
			case TYPE_USE:
				visitor.visitAnnotationOnTypeUse(up().get(), this, (JCAnnotation) get());
				break;
			default:
				throw new AssertionError("Annotion not expected as child of a " + up().getKind());
			}
			break;
		case TYPE_USE:
			visitor.visitTypeUse(this, get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitTypeUse(this, get());
			break;
		default:
			throw new AssertionError("Unexpected kind during node traversal: " + getKind());
		}
	}
348842
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (AstNode e : getElements()) {
                e.visit(v);
            }
        }
    }
342332
def visited_children
      children.map do |node|
        if node.is_a?(Parser::AST::Node)
          visit(node)
        else
          node
        end
      end
    end
1344872
public static void visitAllNodes(Node node, NodeVisitor<? super Node, VisitDirective> visitor) {
    ArrayDeque<Node> queue = new ArrayDeque<>();
    queue.add(node);
    Node current;
    while ((current = queue.poll()) != null) {
      switch (visitor.exec(current)) {
        case ABORT:
          return;
        case CONTINUE:
          if (current instanceof ParentNode<?>) {
            queue.addAll(((ParentNode<?>) current).getChildren());
          }
          if (current instanceof ExprHolderNode) {
            queue.addAll(((ExprHolderNode) current).getExprList());
          }
          continue;
        case SKIP_CHILDREN:
          continue;
      }
    }
  }
1084745
private function _visitNode($node)
    {
        $this->_nodeStates[$node->name] = self::IN_PROGRESS;

        if (isset($this->_relatedClasses[$node->name])) {
            foreach ($this->_relatedClasses[$node->name] as $relatedNode) {
                if ($this->_nodeStates[$relatedNode->name] == self::NOT_VISITED) {
                    $this->_visitNode($relatedNode);
                }
            }
        }

        $this->_nodeStates[$node->name] = self::VISITED;
        $this->_sorted[] = $node;
    }
16238
public <R> void visit(String key, Visitor<T, R> visitor) {
        if (root != null) {
            visit(key, visitor, null, root);
        }
    }
536850
def process_node(node, level=1)
      entries = node.children
      @visitor.enter_node(node)
      entries.each do |entry|
        unless is_leaf?(entry)
          process_node(entry, level+1)
        else
          @visitor.visit_leaf(entry)
        end
      end
      @visitor.exit_node(node)
    end
1297338
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            if (functionName != null) {
                functionName.visit(v);
            }
            for (AstNode param : getParams()) {
                param.visit(v);
            }
            getBody().visit(v);
            if (!isExpressionClosure) {
                if (memberExprNode != null) {
                    memberExprNode.visit(v);
                }
            }
        }
    }
86920
def visit(node)
      if respond_to?(node.class.visit_method, true)
        send(node.class.visit_method, node) {visit_children(node)}
      else
        visit_children(node)
      end
    end
737755
def visit(ast_node, parent)
      klass = TYPES[ast_node.type] || return
      klass.new.build_from_ast(ast_node).tap do |node|
        parent.children << node
      end
    end
674961
protected void visitChildNodes(NodeData node) throws RepositoryException
   {
      if (isInterrupted())
         return;
      for (NodeData data : dataManager.getChildNodesData(node))
      {
         if (isInterrupted())
            return;
         data.accept(this);
      }
   }
1189976
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (AstNode var : variables) {
                var.visit(v);
            }
        }
    }
555367
@Override
  protected void visitChildren(ParentSoyNode<?> node) {
    for (SoyNode child : node.getChildren()) {
      visit(child);
    }
  }
1101430
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            body.visit(v);
            condition.visit(v);
        }
    }
1270507
def depth_first_recurse(node = nil, depth = 0, &block)
      node = self if node == nil
      yield node, depth
      node.children.each do |child|
        depth_first_recurse(child, depth+1, &block)
      end
    end
254208
function traverseDepthFirst(rootNode, options) {
  options = extend({
    subnodesAccessor: function(node) { return node.subnodes; },
    userdataAccessor: function(node, userdata) { return userdata; },
    onNode: function(node, callback, userdata) { callback(); },
    onComplete: function(rootNode) {},
    userdata: null
  }, options);

  var stack = [];
  stack.push([rootNode, options.userdata]);

  (function next() {
    if (stack.length == 0) {
      options.onComplete(rootNode);
      return;
    }

    var top = stack.pop();
    var node = top[0];
    var data = top[1];

    options.onNode(node, function() {
      var subnodeData = options.userdataAccessor(node, data);
      var subnodes = options.subnodesAccessor(node);
      async.eachSeries(subnodes,
        function(subnode, nextNode) {
          stack.push([subnode, subnodeData]);
          async.setImmediate(nextNode);
        },
        function() {
          async.setImmediate(next);
        }
      );
    }, data);
  })();
}
1044558
def traverse_children(aParentNode)
      children = aParentNode.children
      broadcast(:before_subnodes, aParentNode, children)

      # Let's proceed with the visit of children
      children.each_with_index do |a_node, i|
        edge_sign = aParentNode.signatures[i]
        if a_node.kind_of?(SPPF::CompositeNode)
          push_node(a_node, edge_sign)
          access_paths = node_accesses[a_node]
          last_path = legs.last[-1]
          path_reused = access_paths.include?(last_path)
          unless path_reused
            node_accesses[a_node].push(last_path)
            a_node.accept(self)
          end
          pop_node
        else
          a_node.accept(self)
        end
      end

      broadcast(:after_subnodes, aParentNode, children)
    end