class NodeVisitorBase {
    protected abstract void visit(@NotNull Node node);

    public void visitChildren(@NotNull Node parent) {<FILL_FUNCTION_BODY>}
}

        Node node = parent.getFirstChild();
        while (node != null) {
            // A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
            // node after visiting it. So get the next node before visiting.
            Node next = node.getNext();
            visit(node);
            node = next;
        }
    
<no_super_class>