EclipseJDT Source Viewer

Home|eclipse_jdt/src/org/eclipse/jdt/core/dom/ASTVisitor.java
1/*******************************************************************************
2 * Copyright (c) 2000, 2022 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 *     IBM Corporation - initial API and implementation
13 *******************************************************************************/
14
15package org.eclipse.jdt.core.dom;
16
17import java.util.Stack;
18import org.eclipse.jdt.core.dom.scope.ASTScope;
19
20/**
21 * A visitor for abstract syntax trees.
22 * <p>
23 * For each different concrete AST node type <i>T</i> there are
24 * a pair of methods:
25 * <ul>
26 * <li><code>public boolean visit(<i>T</i> node)</code> - Visits
27 * the given node to perform some arbitrary operation. If <code>true</code>
28 * is returned, the given node's child nodes will be visited next; however,
29 * if <code>false</code> is returned, the given node's child nodes will
30 * not be visited. The default implementation provided by this class does
31 * nothing and returns <code>true</code> (with the exception of
32 * {@link #visit(Javadoc) ASTVisitor.visit(Javadoc)}).
33 * Subclasses may reimplement this method as needed.</li>
34 * <li><code>public void endVisit(<i>T</i> node)</code> - Visits
35 * the given node to perform some arbitrary operation. When used in the
36 * conventional way, this method is called after all of the given node's
37 * children have been visited (or immediately, if <code>visit</code> returned
38 * <code>false</code>). The default implementation provided by this class does
39 * nothing. Subclasses may reimplement this method as needed.</li>
40 * </ul>
41 * <p>
42 * In addition, there are a pair of methods for visiting AST nodes in the
43 * abstract, regardless of node type:
44 * <ul>
45 * <li><code>public void preVisit(ASTNode node)</code> - Visits
46 * the given node to perform some arbitrary operation.
47 * This method is invoked prior to the appropriate type-specific
48 * <code>visit</code> method.
49 * The default implementation of this method does nothing.
50 * Subclasses may reimplement this method as needed.</li>
51 * <li><code>public void postVisit(ASTNode node)</code> - Visits
52 * the given node to perform some arbitrary operation.
53 * This method is invoked after the appropriate type-specific
54 * <code>endVisit</code> method.
55 * The default implementation of this method does nothing.
56 * Subclasses may reimplement this method as needed.</li>
57 * </ul>
58 * <p>
59 * For nodes with list-valued properties, the child nodes within the list
60 * are visited in order. For nodes with multiple properties, the child nodes
61 * are visited in the order that most closely corresponds to the lexical
62 * reading order of the source program. For instance, for a type declaration
63 * node, the child ordering is: name, superclass, superinterfaces, and
64 * body declarations.
65 * </p>
66 * <p>
67 * While it is possible to modify the tree in the visitor, care is required to
68 * ensure that the consequences are as expected and desirable.
69 * During the course of an ordinary visit starting at a given node, every node
70 * in the subtree is visited exactly twice, first with <code>visit</code> and
71 * then with <code>endVisit</code>. During a traversal of a stationary tree,
72 * each node is either behind (after <code>endVisit</code>), ahead (before
73 * <code>visit</code>), or in progress (between <code>visit</code> and
74 * the matching <code>endVisit</code>). Changes to the "behind" region of the
75 * tree are of no consequence to the visit in progress. Changes to the "ahead"
76 * region will be taken in stride. Changes to the "in progress" portion are
77 * the more interesting cases. With a node, the various properties are arranged
78 * in a linear list, with a cursor that separates the properties that have
79 * been visited from the ones that are still to be visited (the cursor
80 * is between the elements, rather than on an element). The cursor moves from
81 * the head to the tail of this list, advancing to the next position just
82 * <i>before</i> <code>visit</code> if called for that child. After the child
83 * subtree has been completely visited, the visit moves on the child
84 * immediately after the cursor. Removing a child while it is being visited
85 * does not alter the course of the visit. But any children added at positions
86 * after the cursor are considered in the "ahead" portion and will be visited.
87 * </p>
88 * <p>
89 * Cases to watch out for:
90 * <ul>
91 * <li>Moving a child node further down the list. This could result in the
92 * child subtree being visited multiple times; these visits are sequential.</li>
93 * <li>Moving a child node up into an ancestor. If the new home for
94 * the node is in the "ahead" portion, the subtree will be visited
95 * a second time; again, these visits are sequential.</li>
96 * <li>Moving a node down into a child. If the new home for
97 * the node is in the "ahead" portion, the subtree will be visited
98 * a second time; in this case, the visits will be nested. In some cases,
99 * this can lead to a stack overflow or out of memory condition.</li>
100 * </ul>
101 * <p>
102 * Note that {@link LineComment} and {@link BlockComment} nodes are
103 * not normally visited in an AST because they are not considered
104 * part of main structure of the AST. Use
105 * {@link CompilationUnit#getCommentList()} to find these additional
106 * comments nodes.
107 * </p>
108 *
109 * @see org.eclipse.jdt.core.dom.ASTNode#accept(ASTVisitor)
110 */
111public abstract class ASTVisitor {
112    public ASTScope topScope = new ASTScope(ASTScope.ScopePackageNamenull);
113    public Stack<ASTScopescopeStack = new Stack<ASTScope>();
114
115    public ASTScope currentScope = topScope;
116
117    public ASTScope pushScope(String identName) {
118        currentScope = currentScope.createChild(identName);
119        scopeStack.push(currentScope);
120        return currentScope;
121    }
122
123    public ASTScope popScope() {
124        scopeStack.pop();
125        currentScope = scopeStack.peek();
126        return currentScope;
127    }
128
129    public ASTScope getScope() {
130        return currentScope;
131    }
132
133    /**
134     * Indicates whether doc tags should be visited by default.
135     * 
136     * @since 3.0
137     */
138    private boolean visitDocTags;
139
140    /**
141     * Creates a new AST visitor instance.
142     * <p>
143     * For backwards compatibility, the visitor does not visit tag
144     * elements below doc comments by default. Use
145     * {@link #ASTVisitor(boolean) ASTVisitor(true)}
146     * for an visitor that includes doc comments by default.
147     * </p>
148     */
149    public ASTVisitor() {
150        this(false);
151        scopeStack.push(topScope);
152    }
153
154    /**
155     * Creates a new AST visitor instance.
156     *
157     * @param visitDocTags <code>true</code> if doc comment tags are
158     *                     to be visited by default, and <code>false</code>
159     *                     otherwise
160     * @see Javadoc#tags()
161     * @see #visit(Javadoc)
162     * @since 3.0
163     */
164    public ASTVisitor(boolean visitDocTags) {
165        this.visitDocTags = visitDocTags;
166        scopeStack.push(topScope);
167    }
168
169    /**
170     * Visits the given AST node prior to the type-specific visit
171     * (before <code>visit</code>).
172     * <p>
173     * The default implementation does nothing. Subclasses may reimplement.
174     * </p>
175     *
176     * @param node the node to visit
177     *
178     * @see #preVisit2(ASTNode)
179     */
180    public void preVisit(ASTNode node) {
181        // default implementation: do nothing
182    }
183
184    /**
185     * Visits the given AST node prior to the type-specific visit (before
186     * <code>visit</code>).
187     * <p>
188     * The default implementation calls {@link #preVisit(ASTNode)} and then
189     * returns true. Subclasses may reimplement.
190     * </p>
191     *
192     * @param node the node to visit
193     * @return <code>true</code> if <code>visit(node)</code> should be called,
194     *         and <code>false</code> otherwise.
195     * @see #preVisit(ASTNode)
196     * @since 3.5
197     */
198    public boolean preVisit2(ASTNode node) {
199        preVisit(node);
200        return true;
201    }
202
203    /**
204     * Visits the given AST node following the type-specific visit
205     * (after <code>endVisit</code>).
206     * <p>
207     * The default implementation does nothing. Subclasses may reimplement.
208     * </p>
209     *
210     * @param node the node to visit
211     */
212    public void postVisit(ASTNode node) {
213        // default implementation: do nothing
214    }
215
216    /**
217     * Visits the given type-specific AST node.
218     * <p>
219     * The default implementation does nothing and return true.
220     * Subclasses may reimplement.
221     * </p>
222     *
223     * @param node the node to visit
224     * @return <code>true</code> if the children of this node should be
225     *         visited, and <code>false</code> if the children of this node should
226     *         be skipped
227     * @since 3.1
228     */
229    public boolean visit(AnnotationTypeDeclaration node) {
230        return true;
231    }
232
233    /**
234     * Visits the given type-specific AST node.
235     * <p>
236     * The default implementation does nothing and return true.
237     * Subclasses may reimplement.
238     * </p>
239     *
240     * @param node the node to visit
241     * @return <code>true</code> if the children of this node should be
242     *         visited, and <code>false</code> if the children of this node should
243     *         be skipped
244     * @since 3.1
245     */
246    public boolean visit(AnnotationTypeMemberDeclaration node) {
247        return true;
248    }
249
250    /**
251     * Visits the given type-specific AST node.
252     * <p>
253     * The default implementation does nothing and return true.
254     * Subclasses may reimplement.
255     * </p>
256     *
257     * @param node the node to visit
258     * @return <code>true</code> if the children of this node should be
259     *         visited, and <code>false</code> if the children of this node should
260     *         be skipped
261     */
262    public boolean visit(AnonymousClassDeclaration node) {
263        return true;
264    }
265
266    /**
267     * Visits the given type-specific AST node.
268     * <p>
269     * The default implementation does nothing and return true.
270     * Subclasses may reimplement.
271     * </p>
272     *
273     * @param node the node to visit
274     * @return <code>true</code> if the children of this node should be
275     *         visited, and <code>false</code> if the children of this node should
276     *         be skipped
277     */
278    public boolean visit(ArrayAccess node) {
279        return true;
280    }
281
282    /**
283     * Visits the given type-specific AST node.
284     * <p>
285     * The default implementation does nothing and return true.
286     * Subclasses may reimplement.
287     * </p>
288     *
289     * @param node the node to visit
290     * @return <code>true</code> if the children of this node should be
291     *         visited, and <code>false</code> if the children of this node should
292     *         be skipped
293     */
294    public boolean visit(ArrayCreation node) {
295        return true;
296    }
297
298    /**
299     * Visits the given type-specific AST node.
300     * <p>
301     * The default implementation does nothing and return true.
302     * Subclasses may reimplement.
303     * </p>
304     *
305     * @param node the node to visit
306     * @return <code>true</code> if the children of this node should be
307     *         visited, and <code>false</code> if the children of this node should
308     *         be skipped
309     */
310    public boolean visit(ArrayInitializer node) {
311        return true;
312    }
313
314    /**
315     * Visits the given type-specific AST node.
316     * <p>
317     * The default implementation does nothing and return true.
318     * Subclasses may reimplement.
319     * </p>
320     *
321     * @param node the node to visit
322     * @return <code>true</code> if the children of this node should be
323     *         visited, and <code>false</code> if the children of this node should
324     *         be skipped
325     */
326    public boolean visit(ArrayType node) {
327        return true;
328    }
329
330    /**
331     * Visits the given type-specific AST node.
332     * <p>
333     * The default implementation does nothing and return true.
334     * Subclasses may reimplement.
335     * </p>
336     *
337     * @param node the node to visit
338     * @return <code>true</code> if the children of this node should be
339     *         visited, and <code>false</code> if the children of this node should
340     *         be skipped
341     */
342    public boolean visit(AssertStatement node) {
343        return true;
344    }
345
346    /**
347     * Visits the given type-specific AST node.
348     * <p>
349     * The default implementation does nothing and return true.
350     * Subclasses may reimplement.
351     * </p>
352     *
353     * @param node the node to visit
354     * @return <code>true</code> if the children of this node should be
355     *         visited, and <code>false</code> if the children of this node should
356     *         be skipped
357     */
358    public boolean visit(Assignment node) {
359        return true;
360    }
361
362    /**
363     * Visits the given type-specific AST node.
364     * <p>
365     * The default implementation does nothing and return true.
366     * Subclasses may reimplement.
367     * </p>
368     *
369     * @param node the node to visit
370     * @return <code>true</code> if the children of this node should be
371     *         visited, and <code>false</code> if the children of this node should
372     *         be skipped
373     */
374    public boolean visit(Block node) {
375        return true;
376    }
377
378    /**
379     * Visits the given type-specific AST node.
380     * <p>
381     * The default implementation does nothing and return true.
382     * Subclasses may reimplement.
383     * </p>
384     * <p>
385     * Note: {@link LineComment} and {@link BlockComment} nodes are
386     * not considered part of main structure of the AST. This method will
387     * only be called if a client goes out of their way to visit this
388     * kind of node explicitly.
389     * </p>
390     *
391     * @param node the node to visit
392     * @return <code>true</code> if the children of this node should be
393     *         visited, and <code>false</code> if the children of this node should
394     *         be skipped
395     * @since 3.0
396     */
397    public boolean visit(BlockComment node) {
398        return true;
399    }
400
401    /**
402     * Visits the given type-specific AST node.
403     * <p>
404     * The default implementation does nothing and return true.
405     * Subclasses may reimplement.
406     * </p>
407     *
408     * @param node the node to visit
409     * @return <code>true</code> if the children of this node should be
410     *         visited, and <code>false</code> if the children of this node should
411     *         be skipped
412     */
413    public boolean visit(BooleanLiteral node) {
414        return true;
415    }
416
417    /**
418     * Visits the given type-specific AST node.
419     * <p>
420     * The default implementation does nothing and return true.
421     * Subclasses may reimplement.
422     * </p>
423     *
424     * @param node the node to visit
425     * @return <code>true</code> if the children of this node should be
426     *         visited, and <code>false</code> if the children of this node should
427     *         be skipped
428     */
429    public boolean visit(BreakStatement node) {
430        return true;
431    }
432
433    /**
434     * Visits the given type-specific AST node.
435     * <p>
436     * The default implementation does nothing and return true.
437     * Subclasses may reimplement.
438     * </p>
439     *
440     * @param node the node to visit
441     * @return <code>true</code> if the children of this node should be
442     *         visited, and <code>false</code> if the children of this node should
443     *         be skipped
444     * @since 3.28
445     */
446    public boolean visit(CaseDefaultExpression node) {
447        return true;
448    }
449
450    /**
451     * Visits the given type-specific AST node.
452     * <p>
453     * The default implementation does nothing and return true.
454     * Subclasses may reimplement.
455     * </p>
456     *
457     * @param node the node to visit
458     * @return <code>true</code> if the children of this node should be
459     *         visited, and <code>false</code> if the children of this node should
460     *         be skipped
461     */
462    public boolean visit(CastExpression node) {
463        return true;
464    }
465
466    /**
467     * Visits the given type-specific AST node.
468     * <p>
469     * The default implementation does nothing and return true.
470     * Subclasses may reimplement.
471     * </p>
472     *
473     * @param node the node to visit
474     * @return <code>true</code> if the children of this node should be
475     *         visited, and <code>false</code> if the children of this node should
476     *         be skipped
477     */
478    public boolean visit(CatchClause node) {
479        return true;
480    }
481
482    /**
483     * Visits the given type-specific AST node.
484     * <p>
485     * The default implementation does nothing and return true.
486     * Subclasses may reimplement.
487     * </p>
488     *
489     * @param node the node to visit
490     * @return <code>true</code> if the children of this node should be
491     *         visited, and <code>false</code> if the children of this node should
492     *         be skipped
493     */
494    public boolean visit(CharacterLiteral node) {
495        return true;
496    }
497
498    /**
499     * Visits the given type-specific AST node.
500     * <p>
501     * The default implementation does nothing and return true.
502     * Subclasses may reimplement.
503     * </p>
504     *
505     * @param node the node to visit
506     * @return <code>true</code> if the children of this node should be
507     *         visited, and <code>false</code> if the children of this node should
508     *         be skipped
509     */
510    public boolean visit(ClassInstanceCreation node) {
511        return true;
512    }
513
514    /**
515     * Visits the given type-specific AST node.
516     * <p>
517     * The default implementation does nothing and return true.
518     * Subclasses may reimplement.
519     * </p>
520     *
521     * @param node the node to visit
522     * @return <code>true</code> if the children of this node should be
523     *         visited, and <code>false</code> if the children of this node should
524     *         be skipped
525     */
526    public boolean visit(CompilationUnit node) {
527        return true;
528    }
529
530    /**
531     * Visits the given type-specific AST node.
532     * <p>
533     * The default implementation does nothing and return true.
534     * Subclasses may reimplement.
535     * </p>
536     *
537     * @param node the node to visit
538     * @return <code>true</code> if the children of this node should be
539     *         visited, and <code>false</code> if the children of this node should
540     *         be skipped
541     */
542    public boolean visit(ConditionalExpression node) {
543        return true;
544    }
545
546    /**
547     * Visits the given type-specific AST node.
548     * <p>
549     * The default implementation does nothing and return true.
550     * Subclasses may reimplement.
551     * </p>
552     *
553     * @param node the node to visit
554     * @return <code>true</code> if the children of this node should be
555     *         visited, and <code>false</code> if the children of this node should
556     *         be skipped
557     */
558    public boolean visit(ConstructorInvocation node) {
559        return true;
560    }
561
562    /**
563     * Visits the given type-specific AST node.
564     * <p>
565     * The default implementation does nothing and return true.
566     * Subclasses may reimplement.
567     * </p>
568     *
569     * @param node the node to visit
570     * @return <code>true</code> if the children of this node should be
571     *         visited, and <code>false</code> if the children of this node should
572     *         be skipped
573     */
574    public boolean visit(ContinueStatement node) {
575        return true;
576    }
577
578    /**
579     * Visits the given type-specific AST node.
580     * <p>
581     * The default implementation does nothing and return true.
582     * Subclasses may re-implement.
583     * </p>
584     *
585     * @param node the node to visit
586     * @return <code>true</code> if the children of this node should be
587     *         visited, and <code>false</code> if the children of this node should
588     *         be skipped
589     * @since 3.10
590     */
591    public boolean visit(CreationReference node) {
592        return true;
593    }
594
595    /**
596     * Visits the given type-specific AST node.
597     * <p>
598     * The default implementation does nothing and return true.
599     * Subclasses may reimplement.
600     * </p>
601     *
602     * @param node the node to visit
603     * @return <code>true</code> if the children of this node should be
604     *         visited, and <code>false</code> if the children of this node should
605     *         be skipped
606     * @since 3.10
607     */
608    public boolean visit(Dimension node) {
609        return true;
610    }
611
612    /**
613     * Visits the given type-specific AST node.
614     * <p>
615     * The default implementation does nothing and return true.
616     * Subclasses may reimplement.
617     * </p>
618     *
619     * @param node the node to visit
620     * @return <code>true</code> if the children of this node should be
621     *         visited, and <code>false</code> if the children of this node should
622     *         be skipped
623     */
624    public boolean visit(DoStatement node) {
625        return true;
626    }
627
628    /**
629     * Visits the given type-specific AST node.
630     * <p>
631     * The default implementation does nothing and return true.
632     * Subclasses may reimplement.
633     * </p>
634     *
635     * @param node the node to visit
636     * @return <code>true</code> if the children of this node should be
637     *         visited, and <code>false</code> if the children of this node should
638     *         be skipped
639     */
640    public boolean visit(EmptyStatement node) {
641        return true;
642    }
643
644    /**
645     * Visits the given type-specific AST node.
646     * <p>
647     * The default implementation does nothing and return true.
648     * Subclasses may reimplement.
649     * </p>
650     *
651     * @param node the node to visit
652     * @return <code>true</code> if the children of this node should be
653     *         visited, and <code>false</code> if the children of this node should
654     *         be skipped
655     * @since 3.1
656     */
657    public boolean visit(EnhancedForStatement node) {
658        return true;
659    }
660
661    /**
662     * Visits the given type-specific AST node.
663     * <p>
664     * The default implementation does nothing and return true.
665     * Subclasses may reimplement.
666     * </p>
667     *
668     * @param node the node to visit
669     * @return <code>true</code> if the children of this node should be
670     *         visited, and <code>false</code> if the children of this node should
671     *         be skipped
672     * @since 3.1
673     */
674    public boolean visit(EnumConstantDeclaration node) {
675        return true;
676    }
677
678    /**
679     * Visits the given type-specific AST node.
680     * <p>
681     * The default implementation does nothing and return true.
682     * Subclasses may reimplement.
683     * </p>
684     *
685     * @param node the node to visit
686     * @return <code>true</code> if the children of this node should be
687     *         visited, and <code>false</code> if the children of this node should
688     *         be skipped
689     * @since 3.1
690     */
691    public boolean visit(EnumDeclaration node) {
692        return true;
693    }
694
695    /**
696     * Visits the given type-specific AST node.
697     * <p>
698     * The default implementation does nothing and return true.
699     * Subclasses may re-implement.
700     * </p>
701     *
702     * @param node the node to visit
703     * @return <code>true</code> if the children of this node should be
704     *         visited, and <code>false</code> if the children of this node should
705     *         be skipped
706     * @since 3.14
707     */
708    public boolean visit(ExportsDirective node) {
709        return true;
710    }
711
712    /**
713     * Visits the given type-specific AST node.
714     * <p>
715     * The default implementation does nothing and return true.
716     * Subclasses may re-implement.
717     * </p>
718     *
719     * @param node the node to visit
720     * @return <code>true</code> if the children of this node should be
721     *         visited, and <code>false</code> if the children of this node should
722     *         be skipped
723     * @since 3.10
724     */
725    public boolean visit(ExpressionMethodReference node) {
726        return true;
727    }
728
729    /**
730     * Visits the given type-specific AST node.
731     * <p>
732     * The default implementation does nothing and return true.
733     * Subclasses may reimplement.
734     * </p>
735     *
736     * @param node the node to visit
737     * @return <code>true</code> if the children of this node should be
738     *         visited, and <code>false</code> if the children of this node should
739     *         be skipped
740     */
741    public boolean visit(ExpressionStatement node) {
742        return true;
743    }
744
745    /**
746     * Visits the given type-specific AST node.
747     * <p>
748     * The default implementation does nothing and return true.
749     * Subclasses may reimplement.
750     * </p>
751     *
752     * @param node the node to visit
753     * @return <code>true</code> if the children of this node should be
754     *         visited, and <code>false</code> if the children of this node should
755     *         be skipped
756     */
757    public boolean visit(FieldAccess node) {
758        return true;
759    }
760
761    /**
762     * Visits the given type-specific AST node.
763     * <p>
764     * The default implementation does nothing and return true.
765     * Subclasses may reimplement.
766     * </p>
767     *
768     * @param node the node to visit
769     * @return <code>true</code> if the children of this node should be
770     *         visited, and <code>false</code> if the children of this node should
771     *         be skipped
772     */
773    public boolean visit(FieldDeclaration node) {
774        return true;
775    }
776
777    /**
778     * Visits the given type-specific AST node.
779     * <p>
780     * The default implementation does nothing and return true.
781     * Subclasses may reimplement.
782     * </p>
783     *
784     * @param node the node to visit
785     * @return <code>true</code> if the children of this node should be
786     *         visited, and <code>false</code> if the children of this node should
787     *         be skipped
788     */
789    public boolean visit(ForStatement node) {
790        return true;
791    }
792
793    /**
794     * Visits the given type-specific AST node.
795     * <p>
796     * The default implementation does nothing and return true.
797     * Subclasses may reimplement.
798     * </p>
799     *
800     * @param node the node to visit
801     * @return <code>true</code> if the children of this node should be
802     *         visited, and <code>false</code> if the children of this node should
803     *         be skipped
804     * @since 3.28
805     */
806    public boolean visit(GuardedPattern node) {
807        return true;
808    }
809
810    /**
811     * Visits the given type-specific AST node.
812     * <p>
813     * The default implementation does nothing and return true.
814     * Subclasses may reimplement.
815     * </p>
816     *
817     * @param node the node to visit
818     * @return <code>true</code> if the children of this node should be
819     *         visited, and <code>false</code> if the children of this node should
820     *         be skipped
821     */
822    public boolean visit(IfStatement node) {
823        return true;
824    }
825
826    /**
827     * Visits the given type-specific AST node.
828     * <p>
829     * The default implementation does nothing and return true.
830     * Subclasses may reimplement.
831     * </p>
832     *
833     * @param node the node to visit
834     * @return <code>true</code> if the children of this node should be
835     *         visited, and <code>false</code> if the children of this node should
836     *         be skipped
837     */
838    public boolean visit(ImportDeclaration node) {
839        return true;
840    }
841
842    /**
843     * Visits the given type-specific AST node.
844     * <p>
845     * The default implementation does nothing and return true.
846     * Subclasses may reimplement.
847     * </p>
848     *
849     * @param node the node to visit
850     * @return <code>true</code> if the children of this node should be
851     *         visited, and <code>false</code> if the children of this node should
852     *         be skipped
853     */
854    public boolean visit(InfixExpression node) {
855        return true;
856    }
857
858    /**
859     * Visits the given type-specific AST node.
860     * <p>
861     * The default implementation does nothing and return true.
862     * Subclasses may reimplement.
863     * </p>
864     *
865     * @param node the node to visit
866     * @return <code>true</code> if the children of this node should be
867     *         visited, and <code>false</code> if the children of this node should
868     *         be skipped
869     */
870    public boolean visit(Initializer node) {
871        return true;
872    }
873
874    /**
875     * Visits the given type-specific AST node.
876     * <p>
877     * The default implementation does nothing and return true.
878     * Subclasses may reimplement.
879     * </p>
880     *
881     * @param node the node to visit
882     * @return <code>true</code> if the children of this node should be
883     *         visited, and <code>false</code> if the children of this node should
884     *         be skipped
885     */
886    public boolean visit(InstanceofExpression node) {
887        return true;
888    }
889
890    /**
891     * Visits the given type-specific AST node.
892     * <p>
893     * The default implementation does nothing and return true.
894     * Subclasses may reimplement.
895     * </p>
896     *
897     * @param node the node to visit
898     * @return <code>true</code> if the children of this node should be
899     *         visited, and <code>false</code> if the children of this node should
900     *         be skipped
901     * @since 3.10
902     */
903    public boolean visit(IntersectionType node) {
904        return true;
905    }
906
907    /**
908     * Visits the given AST node.
909     * <p>
910     * Unlike other node types, the boolean returned by the default
911     * implementation is controlled by a constructor-supplied
912     * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)}
913     * which is <code>false</code> by default.
914     * Subclasses may reimplement.
915     * </p>
916     *
917     * @param node the node to visit
918     * @return <code>true</code> if the children of this node should be
919     *         visited, and <code>false</code> if the children of this node should
920     *         be skipped
921     * @see #ASTVisitor()
922     * @see #ASTVisitor(boolean)
923     */
924    public boolean visit(Javadoc node) {
925        // visit tag elements inside doc comments only if requested
926        return this.visitDocTags;
927    }
928
929    /**
930     * Visits the given AST node.
931     * <p>
932     * Unlike other node types, the boolean returned by the default
933     * implementation is controlled by a constructor-supplied
934     * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)}
935     * which is <code>false</code> by default.
936     * Subclasses may reimplement.
937     * </p>
938     *
939     * @param node the node to visit
940     * @return <code>true</code> if the children of this node should be
941     *         visited, and <code>false</code> if the children of this node should
942     *         be skipped
943     * @see #ASTVisitor()
944     * @see #ASTVisitor(boolean)
945     * @since 3.30
946     */
947    public boolean visit(JavaDocRegion node) {
948        return this.visitDocTags;
949    }
950
951    /**
952     * Visits the given type-specific AST node.
953     * <p>
954     * The default implementation does nothing and return true.
955     * Subclasses may reimplement.
956     * </p>
957     *
958     * @param node the node to visit
959     * @return <code>true</code> if the children of this node should be
960     *         visited, and <code>false</code> if the children of this node should
961     *         be skipped
962     */
963    public boolean visit(LabeledStatement node) {
964        return true;
965    }
966
967    /**
968     * Visits the given type-specific AST node.
969     * <p>
970     * The default implementation does nothing and return true.
971     * Subclasses may reimplement.
972     * </p>
973     *
974     * @param node the node to visit
975     * @return <code>true</code> if the children of this node should be
976     *         visited, and <code>false</code> if the children of this node should
977     *         be skipped
978     * @since 3.10
979     */
980    public boolean visit(LambdaExpression node) {
981        return true;
982    }
983
984    /**
985     * Visits the given type-specific AST node.
986     * <p>
987     * The default implementation does nothing and return true.
988     * Subclasses may reimplement.
989     * </p>
990     * <p>
991     * Note: {@link LineComment} and {@link BlockComment} nodes are
992     * not considered part of main structure of the AST. This method will
993     * only be called if a client goes out of their way to visit this
994     * kind of node explicitly.
995     * </p>
996     *
997     * @param node the node to visit
998     * @return <code>true</code> if the children of this node should be
999     *         visited, and <code>false</code> if the children of this node should
1000     *         be skipped
1001     * @since 3.0
1002     */
1003    public boolean visit(LineComment node) {
1004        return true;
1005    }
1006
1007    /**
1008     * Visits the given type-specific AST node.
1009     * <p>
1010     * The default implementation does nothing and return true.
1011     * Subclasses may reimplement.
1012     * </p>
1013     *
1014     * @param node the node to visit
1015     * @return <code>true</code> if the children of this node should be
1016     *         visited, and <code>false</code> if the children of this node should
1017     *         be skipped
1018     * @since 3.1
1019     */
1020    public boolean visit(MarkerAnnotation node) {
1021        return true;
1022    }
1023
1024    /**
1025     * Visits the given type-specific AST node.
1026     * <p>
1027     * The default implementation does nothing and return true.
1028     * Subclasses may reimplement.
1029     * </p>
1030     *
1031     * @param node the node to visit
1032     * @return <code>true</code> if the children of this node should be
1033     *         visited, and <code>false</code> if the children of this node should
1034     *         be skipped
1035     * @since 3.0
1036     */
1037    public boolean visit(MemberRef node) {
1038        return true;
1039    }
1040
1041    /**
1042     * Visits the given type-specific AST node.
1043     * <p>
1044     * The default implementation does nothing and return true.
1045     * Subclasses may reimplement.
1046     * </p>
1047     *
1048     * @param node the node to visit
1049     * @return <code>true</code> if the children of this node should be
1050     *         visited, and <code>false</code> if the children of this node should
1051     *         be skipped
1052     * @since 3.1
1053     */
1054    public boolean visit(MemberValuePair node) {
1055        return true;
1056    }
1057
1058    /**
1059     * Visits the given type-specific AST node.
1060     * <p>
1061     * The default implementation does nothing and return true.
1062     * Subclasses may reimplement.
1063     * </p>
1064     *
1065     * @param node the node to visit
1066     * @return <code>true</code> if the children of this node should be
1067     *         visited, and <code>false</code> if the children of this node should
1068     *         be skipped
1069     * @since 3.0
1070     */
1071    public boolean visit(MethodRef node) {
1072        return true;
1073    }
1074
1075    /**
1076     * Visits the given type-specific AST node.
1077     * <p>
1078     * The default implementation does nothing and return true.
1079     * Subclasses may reimplement.
1080     * </p>
1081     *
1082     * @param node the node to visit
1083     * @return <code>true</code> if the children of this node should be
1084     *         visited, and <code>false</code> if the children of this node should
1085     *         be skipped
1086     * @since 3.0
1087     */
1088    public boolean visit(MethodRefParameter node) {
1089        return true;
1090    }
1091
1092    /**
1093     * Visits the given type-specific AST node.
1094     * <p>
1095     * The default implementation does nothing and return true.
1096     * Subclasses may reimplement.
1097     * </p>
1098     *
1099     * @param node the node to visit
1100     * @return <code>true</code> if the children of this node should be
1101     *         visited, and <code>false</code> if the children of this node should
1102     *         be skipped
1103     */
1104    public boolean visit(MethodDeclaration node) {
1105        return true;
1106    }
1107
1108    /**
1109     * Visits the given type-specific AST node.
1110     * <p>
1111     * The default implementation does nothing and return true.
1112     * Subclasses may reimplement.
1113     * </p>
1114     *
1115     * @param node the node to visit
1116     * @return <code>true</code> if the children of this node should be
1117     *         visited, and <code>false</code> if the children of this node should
1118     *         be skipped
1119     */
1120    public boolean visit(MethodInvocation node) {
1121        return true;
1122    }
1123
1124    /**
1125     * Visits the given type-specific AST node.
1126     * <p>
1127     * The default implementation does nothing and return true.
1128     * Subclasses may reimplement.
1129     * </p>
1130     *
1131     * @param node the node to visit
1132     * @return <code>true</code> if the children of this node should be
1133     *         visited, and <code>false</code> if the children of this node should
1134     *         be skipped
1135     * @since 3.1
1136     */
1137    public boolean visit(Modifier node) {
1138        return true;
1139    }
1140
1141    /**
1142     * Visits the given type-specific AST node.
1143     * <p>
1144     * The default implementation does nothing and return true.
1145     * Subclasses may reimplement.
1146     * </p>
1147     *
1148     * @param node the node to visit
1149     * @return <code>true</code> if the children of this node should be
1150     *         visited, and <code>false</code> if the children of this node should
1151     *         be skipped
1152     * @since 3.14
1153     */
1154    public boolean visit(ModuleDeclaration node) {
1155        return true;
1156    }
1157
1158    /**
1159     * Visits the given type-specific AST node.
1160     * <p>
1161     * The default implementation does nothing and return true.
1162     * Subclasses may reimplement.
1163     * </p>
1164     *
1165     * @param node the node to visit
1166     * @return <code>true</code> if the children of this node should be
1167     *         visited, and <code>false</code> if the children of this node should
1168     *         be skipped
1169     * @since 3.14
1170     */
1171    public boolean visit(ModuleModifier node) {
1172        return true;
1173    }
1174
1175    /**
1176     * Visits the given type-specific AST node.
1177     * <p>
1178     * The default implementation does nothing and return true.
1179     * Subclasses may reimplement.
1180     * </p>
1181     *
1182     * @param node the node to visit
1183     * @return <code>true</code> if the children of this node should be
1184     *         visited, and <code>false</code> if the children of this node should
1185     *         be skipped
1186     * @since 3.10
1187     */
1188    public boolean visit(NameQualifiedType node) {
1189        return true;
1190    }
1191
1192    /**
1193     * Visits the given type-specific AST node.
1194     * <p>
1195     * The default implementation does nothing and return true.
1196     * Subclasses may reimplement.
1197     * </p>
1198     *
1199     * @param node the node to visit
1200     * @return <code>true</code> if the children of this node should be
1201     *         visited, and <code>false</code> if the children of this node should
1202     *         be skipped
1203     * @since 3.1
1204     */
1205    public boolean visit(NormalAnnotation node) {
1206        return true;
1207    }
1208
1209    /**
1210     * Visits the given type-specific AST node.
1211     * <p>
1212     * The default implementation does nothing and return true.
1213     * Subclasses may reimplement.
1214     * </p>
1215     *
1216     * @param node the node to visit
1217     * @return <code>true</code> if the children of this node should be
1218     *         visited, and <code>false</code> if the children of this node should
1219     *         be skipped
1220     */
1221    public boolean visit(NullLiteral node) {
1222        return true;
1223    }
1224
1225    /**
1226     * Visits the given type-specific AST node.
1227     * <p>
1228     * The default implementation does nothing and return true.
1229     * Subclasses may reimplement.
1230     * </p>
1231     *
1232     * @param node the node to visit
1233     * @return <code>true</code> if the children of this node should be
1234     *         visited, and <code>false</code> if the children of this node should
1235     *         be skipped
1236     * @since 3.28
1237     */
1238    public boolean visit(NullPattern node) {
1239        return true;
1240    }
1241
1242    /**
1243     * Visits the given type-specific AST node.
1244     * <p>
1245     * The default implementation does nothing and return true.
1246     * Subclasses may reimplement.
1247     * </p>
1248     *
1249     * @param node the node to visit
1250     * @return <code>true</code> if the children of this node should be
1251     *         visited, and <code>false</code> if the children of this node should
1252     *         be skipped
1253     */
1254    public boolean visit(NumberLiteral node) {
1255        return true;
1256    }
1257
1258    /**
1259     * Visits the given type-specific AST node.
1260     * <p>
1261     * The default implementation does nothing and return true.
1262     * Subclasses may re-implement.
1263     * </p>
1264     *
1265     * @param node the node to visit
1266     * @return <code>true</code> if the children of this node should be
1267     *         visited, and <code>false</code> if the children of this node should
1268     *         be skipped
1269     * @since 3.14
1270     */
1271    public boolean visit(OpensDirective node) {
1272        return true;
1273    }
1274
1275    /**
1276     * Visits the given type-specific AST node.
1277     * <p>
1278     * The default implementation does nothing and return true.
1279     * Subclasses may reimplement.
1280     * </p>
1281     *
1282     * @param node the node to visit
1283     * @return <code>true</code> if the children of this node should be
1284     *         visited, and <code>false</code> if the children of this node should
1285     *         be skipped
1286     */
1287    public boolean visit(PackageDeclaration node) {
1288        return true;
1289    }
1290
1291    /**
1292     * Visits the given type-specific AST node.
1293     * <p>
1294     * The default implementation does nothing and return true.
1295     * Subclasses may reimplement.
1296     * </p>
1297     *
1298     * @param node the node to visit
1299     * @return <code>true</code> if the children of this node should be
1300     *         visited, and <code>false</code> if the children of this node should
1301     *         be skipped
1302     * @since 3.1
1303     */
1304    public boolean visit(ParameterizedType node) {
1305        return true;
1306    }
1307
1308    /**
1309     * Visits the given type-specific AST node.
1310     * <p>
1311     * The default implementation does nothing and return true.
1312     * Subclasses may reimplement.
1313     * </p>
1314     *
1315     * @param node the node to visit
1316     * @return <code>true</code> if the children of this node should be
1317     *         visited, and <code>false</code> if the children of this node should
1318     *         be skipped
1319     */
1320    public boolean visit(ParenthesizedExpression node) {
1321        return true;
1322    }
1323
1324    /**
1325     * Visits the given type-specific AST node.
1326     * <p>
1327     * The default implementation does nothing and return true.
1328     * Subclasses may reimplement.
1329     * </p>
1330     *
1331     * @param node the node to visit
1332     * @return <code>true</code> if the children of this node should be
1333     *         visited, and <code>false</code> if the children of this node should
1334     *         be skipped
1335     * @since 3.26
1336     */
1337    public boolean visit(PatternInstanceofExpression node) {
1338        return true;
1339    }
1340
1341    /**
1342     * Visits the given type-specific AST node.
1343     * <p>
1344     * The default implementation does nothing and return true.
1345     * Subclasses may reimplement.
1346     * </p>
1347     *
1348     * @param node the node to visit
1349     * @return <code>true</code> if the children of this node should be
1350     *         visited, and <code>false</code> if the children of this node should
1351     *         be skipped
1352     */
1353    public boolean visit(PostfixExpression node) {
1354        return true;
1355    }
1356
1357    /**
1358     * Visits the given type-specific AST node.
1359     * <p>
1360     * The default implementation does nothing and return true.
1361     * Subclasses may reimplement.
1362     * </p>
1363     *
1364     * @param node the node to visit
1365     * @return <code>true</code> if the children of this node should be
1366     *         visited, and <code>false</code> if the children of this node should
1367     *         be skipped
1368     */
1369    public boolean visit(PrefixExpression node) {
1370        return true;
1371    }
1372
1373    /**
1374     * Visits the given type-specific AST node.
1375     * <p>
1376     * The default implementation does nothing and return true.
1377     * Subclasses may re-implement.
1378     * </p>
1379     *
1380     * @param node the node to visit
1381     * @return <code>true</code> if the children of this node should be
1382     *         visited, and <code>false</code> if the children of this node should
1383     *         be skipped
1384     * @since 3.14
1385     */
1386    public boolean visit(ProvidesDirective node) {
1387        return true;
1388    }
1389
1390    /**
1391     * Visits the given type-specific AST node.
1392     * <p>
1393     * The default implementation does nothing and return true.
1394     * Subclasses may reimplement.
1395     * </p>
1396     *
1397     * @param node the node to visit
1398     * @return <code>true</code> if the children of this node should be
1399     *         visited, and <code>false</code> if the children of this node should
1400     *         be skipped
1401     */
1402    public boolean visit(PrimitiveType node) {
1403        return true;
1404    }
1405
1406    /**
1407     * Visits the given type-specific AST node.
1408     * <p>
1409     * The default implementation does nothing and return true.
1410     * Subclasses may reimplement.
1411     * </p>
1412     *
1413     * @param node the node to visit
1414     * @return <code>true</code> if the children of this node should be
1415     *         visited, and <code>false</code> if the children of this node should
1416     *         be skipped
1417     */
1418    public boolean visit(QualifiedName node) {
1419        return true;
1420    }
1421
1422    /**
1423     * Visits the given type-specific AST node.
1424     * <p>
1425     * The default implementation does nothing and return true.
1426     * Subclasses may reimplement.
1427     * </p>
1428     *
1429     * @param node the node to visit
1430     * @return <code>true</code> if the children of this node should be
1431     *         visited, and <code>false</code> if the children of this node should
1432     *         be skipped
1433     * @since 3.1
1434     */
1435    public boolean visit(QualifiedType node) {
1436        return true;
1437    }
1438
1439    /**
1440     * Visits the given type-specific AST node.
1441     * <p>
1442     * The default implementation does nothing and return true.
1443     * Subclasses may reimplement.
1444     * </p>
1445     *
1446     * @param node the node to visit
1447     * @return <code>true</code> if the children of this node should be
1448     *         visited, and <code>false</code> if the children of this node should
1449     *         be skipped
1450     * @noreference
1451     */
1452    public boolean visit(ModuleQualifiedName node) {
1453        return true;
1454    }
1455
1456    /**
1457     * Visits the given type-specific AST node.
1458     * <p>
1459     * The default implementation does nothing and return true.
1460     * Subclasses may re-implement.
1461     * </p>
1462     *
1463     * @param node the node to visit
1464     * @return <code>true</code> if the children of this node should be
1465     *         visited, and <code>false</code> if the children of this node should
1466     *         be skipped
1467     * @since 3.14
1468     */
1469    public boolean visit(RequiresDirective node) {
1470        return true;
1471    }
1472
1473    /**
1474     * Visits the given type-specific AST node.
1475     * <p>
1476     * The default implementation does nothing and return true.
1477     * Subclasses may re-implement.
1478     * </p>
1479     *
1480     * @param node the node to visit
1481     * @return <code>true</code> if the children of this node should be
1482     *         visited, and <code>false</code> if the children of this node should
1483     *         be skipped
1484     * @since 3.22
1485     * @noreference This method is not intended to be referenced by clients.
1486     */
1487    public boolean visit(RecordDeclaration node) {
1488        return true;
1489    }
1490
1491    /**
1492     * Visits the given type-specific AST node.
1493     * <p>
1494     * The default implementation does nothing and return true.
1495     * Subclasses may reimplement.
1496     * </p>
1497     *
1498     * @param node the node to visit
1499     * @return <code>true</code> if the children of this node should be
1500     *         visited, and <code>false</code> if the children of this node should
1501     *         be skipped
1502     */
1503    public boolean visit(ReturnStatement node) {
1504        return true;
1505    }
1506
1507    /**
1508     * Visits the given type-specific AST node.
1509     * <p>
1510     * The default implementation does nothing and return true.
1511     * Subclasses may reimplement.
1512     * </p>
1513     *
1514     * @param node the node to visit
1515     * @return <code>true</code> if the children of this node should be
1516     *         visited, and <code>false</code> if the children of this node should
1517     *         be skipped
1518     */
1519    public boolean visit(SimpleName node) {
1520        return true;
1521    }
1522
1523    /**
1524     * Visits the given type-specific AST node.
1525     * <p>
1526     * The default implementation does nothing and return true.
1527     * Subclasses may reimplement.
1528     * </p>
1529     *
1530     * @param node the node to visit
1531     * @return <code>true</code> if the children of this node should be
1532     *         visited, and <code>false</code> if the children of this node should
1533     *         be skipped
1534     */
1535    public boolean visit(SimpleType node) {
1536        return true;
1537    }
1538
1539    /**
1540     * Visits the given type-specific AST node.
1541     * <p>
1542     * The default implementation does nothing and return true.
1543     * Subclasses may reimplement.
1544     * </p>
1545     *
1546     * @param node the node to visit
1547     * @return <code>true</code> if the children of this node should be
1548     *         visited, and <code>false</code> if the children of this node should
1549     *         be skipped
1550     * @since 3.1
1551     */
1552    public boolean visit(SingleMemberAnnotation node) {
1553        return true;
1554    }
1555
1556    /**
1557     * Visits the given type-specific AST node.
1558     * <p>
1559     * The default implementation does nothing and return true.
1560     * Subclasses may reimplement.
1561     * </p>
1562     *
1563     * @param node the node to visit
1564     * @return <code>true</code> if the children of this node should be
1565     *         visited, and <code>false</code> if the children of this node should
1566     *         be skipped
1567     */
1568    public boolean visit(SingleVariableDeclaration node) {
1569        return true;
1570    }
1571
1572    /**
1573     * Visits the given type-specific AST node.
1574     * <p>
1575     * The default implementation does nothing and return true.
1576     * Subclasses may reimplement.
1577     * </p>
1578     *
1579     * @param node the node to visit
1580     * @return <code>true</code> if the children of this node should be
1581     *         visited, and <code>false</code> if the children of this node should
1582     *         be skipped
1583     */
1584    public boolean visit(StringLiteral node) {
1585        return true;
1586    }
1587
1588    /**
1589     * Visits the given type-specific AST node.
1590     * <p>
1591     * The default implementation does nothing and return true.
1592     * Subclasses may reimplement.
1593     * </p>
1594     *
1595     * @param node the node to visit
1596     * @return <code>true</code> if the children of this node should be
1597     *         visited, and <code>false</code> if the children of this node should
1598     *         be skipped
1599     */
1600    public boolean visit(SuperConstructorInvocation node) {
1601        return true;
1602    }
1603
1604    /**
1605     * Visits the given type-specific AST node.
1606     * <p>
1607     * The default implementation does nothing and return true.
1608     * Subclasses may reimplement.
1609     * </p>
1610     *
1611     * @param node the node to visit
1612     * @return <code>true</code> if the children of this node should be
1613     *         visited, and <code>false</code> if the children of this node should
1614     *         be skipped
1615     */
1616    public boolean visit(SuperFieldAccess node) {
1617        return true;
1618    }
1619
1620    /**
1621     * Visits the given type-specific AST node.
1622     * <p>
1623     * The default implementation does nothing and return true.
1624     * Subclasses may reimplement.
1625     * </p>
1626     *
1627     * @param node the node to visit
1628     * @return <code>true</code> if the children of this node should be
1629     *         visited, and <code>false</code> if the children of this node should
1630     *         be skipped
1631     */
1632    public boolean visit(SuperMethodInvocation node) {
1633        return true;
1634    }
1635
1636    /**
1637     * Visits the given type-specific AST node.
1638     * <p>
1639     * The default implementation does nothing and return true.
1640     * Subclasses may reimplement.
1641     * </p>
1642     *
1643     * @param node the node to visit
1644     * @return <code>true</code> if the children of this node should be
1645     *         visited, and <code>false</code> if the children of this node should
1646     *         be skipped
1647     * @since 3.10
1648     */
1649    public boolean visit(SuperMethodReference node) {
1650        return true;
1651    }
1652
1653    /**
1654     * Visits the given type-specific AST node.
1655     * <p>
1656     * The default implementation does nothing and return true.
1657     * Subclasses may reimplement.
1658     * </p>
1659     *
1660     * @param node the node to visit
1661     * @return <code>true</code> if the children of this node should be
1662     *         visited, and <code>false</code> if the children of this node should
1663     *         be skipped
1664     */
1665    public boolean visit(SwitchCase node) {
1666        return true;
1667    }
1668
1669    /**
1670     * Visits the given type-specific AST node.
1671     * <p>
1672     * The default implementation does nothing and return true.
1673     * Subclasses may reimplement.
1674     * </p>
1675     *
1676     * @param node the node to visit
1677     * @return <code>true</code> if the children of this node should be
1678     *         visited, and <code>false</code> if the children of this node should
1679     *         be skipped
1680     * @since 3.24
1681     */
1682    public boolean visit(SwitchExpression node) {
1683        return true;
1684    }
1685
1686    /**
1687     * Visits the given type-specific AST node.
1688     * <p>
1689     * The default implementation does nothing and return true.
1690     * Subclasses may reimplement.
1691     * </p>
1692     *
1693     * @param node the node to visit
1694     * @return <code>true</code> if the children of this node should be
1695     *         visited, and <code>false</code> if the children of this node should
1696     *         be skipped
1697     */
1698    public boolean visit(SwitchStatement node) {
1699        return true;
1700    }
1701
1702    /**
1703     * Visits the given type-specific AST node.
1704     * <p>
1705     * The default implementation does nothing and return true.
1706     * Subclasses may reimplement.
1707     * </p>
1708     *
1709     * @param node the node to visit
1710     * @return <code>true</code> if the children of this node should be
1711     *         visited, and <code>false</code> if the children of this node should
1712     *         be skipped
1713     */
1714    public boolean visit(SynchronizedStatement node) {
1715        return true;
1716    }
1717
1718    /**
1719     * Visits the given type-specific AST node.
1720     * <p>
1721     * The default implementation does nothing and return true.
1722     * Subclasses may reimplement.
1723     * </p>
1724     *
1725     * @param node the node to visit
1726     * @return <code>true</code> if the children of this node should be
1727     *         visited, and <code>false</code> if the children of this node should
1728     *         be skipped
1729     * @since 3.0
1730     */
1731    public boolean visit(TagElement node) {
1732        return true;
1733    }
1734
1735    /**
1736     * Visits the given type-specific AST node.
1737     * <p>
1738     * The default implementation does nothing and return true.
1739     * Subclasses may reimplement.
1740     * </p>
1741     *
1742     * @param node the node to visit
1743     * @return <code>true</code> if the children of this node should be
1744     *         visited, and <code>false</code> if the children of this node should
1745     *         be skipped
1746     * @since 3.30
1747     */
1748    public boolean visit(TagProperty node) {
1749        return true;
1750    }
1751
1752    /**
1753     * Visits the given type-specific AST node.
1754     * <p>
1755     * The default implementation does nothing and returns true.
1756     * Subclasses may reimplement.
1757     * </p>
1758     *
1759     * @param node the node to visit
1760     * @return <code>true</code> if the children of this node should be
1761     *         visited, and <code>false</code> if the children of this node should
1762     *         be skipped
1763     * @since 3.24
1764     */
1765    public boolean visit(TextBlock node) {
1766        return true;
1767    }
1768
1769    /**
1770     * Visits the given type-specific AST node.
1771     * <p>
1772     * The default implementation does nothing and return true.
1773     * Subclasses may reimplement.
1774     * </p>
1775     *
1776     * @param node the node to visit
1777     * @return <code>true</code> if the children of this node should be
1778     *         visited, and <code>false</code> if the children of this node should
1779     *         be skipped
1780     * @since 3.0
1781     */
1782    public boolean visit(TextElement node) {
1783        return true;
1784    }
1785
1786    /**
1787     * Visits the given type-specific AST node.
1788     * <p>
1789     * The default implementation does nothing and return true.
1790     * Subclasses may reimplement.
1791     * </p>
1792     *
1793     * @param node the node to visit
1794     * @return <code>true</code> if the children of this node should be
1795     *         visited, and <code>false</code> if the children of this node should
1796     *         be skipped
1797     */
1798    public boolean visit(ThisExpression node) {
1799        return true;
1800    }
1801
1802    /**
1803     * Visits the given type-specific AST node.
1804     * <p>
1805     * The default implementation does nothing and return true.
1806     * Subclasses may reimplement.
1807     * </p>
1808     *
1809     * @param node the node to visit
1810     * @return <code>true</code> if the children of this node should be
1811     *         visited, and <code>false</code> if the children of this node should
1812     *         be skipped
1813     */
1814    public boolean visit(ThrowStatement node) {
1815        return true;
1816    }
1817
1818    /**
1819     * Visits the given type-specific AST node.
1820     * <p>
1821     * The default implementation does nothing and return true.
1822     * Subclasses may reimplement.
1823     * </p>
1824     *
1825     * @param node the node to visit
1826     * @return <code>true</code> if the children of this node should be
1827     *         visited, and <code>false</code> if the children of this node should
1828     *         be skipped
1829     */
1830    public boolean visit(TryStatement node) {
1831        return true;
1832    }
1833
1834    /**
1835     * Visits the given type-specific AST node.
1836     * <p>
1837     * The default implementation does nothing and return true.
1838     * Subclasses may reimplement.
1839     * </p>
1840     *
1841     * @param node the node to visit
1842     * @return <code>true</code> if the children of this node should be
1843     *         visited, and <code>false</code> if the children of this node should
1844     *         be skipped
1845     */
1846    public boolean visit(TypeDeclaration node) {
1847        return true;
1848    }
1849
1850    /**
1851     * Visits the given type-specific AST node.
1852     * <p>
1853     * The default implementation does nothing and return true.
1854     * Subclasses may reimplement.
1855     * </p>
1856     *
1857     * @param node the node to visit
1858     * @return <code>true</code> if the children of this node should be
1859     *         visited, and <code>false</code> if the children of this node should
1860     *         be skipped
1861     */
1862    public boolean visit(TypeDeclarationStatement node) {
1863        return true;
1864    }
1865
1866    /**
1867     * Visits the given type-specific AST node.
1868     * <p>
1869     * The default implementation does nothing and return true.
1870     * Subclasses may reimplement.
1871     * </p>
1872     *
1873     * @param node the node to visit
1874     * @return <code>true</code> if the children of this node should be
1875     *         visited, and <code>false</code> if the children of this node should
1876     *         be skipped
1877     */
1878    public boolean visit(TypeLiteral node) {
1879        return true;
1880    }
1881
1882    /**
1883     * Visits the given type-specific AST node.
1884     * <p>
1885     * The default implementation does nothing and return true.
1886     * Subclasses may reimplement.
1887     * </p>
1888     *
1889     * @param node the node to visit
1890     * @return <code>true</code> if the children of this node should be
1891     *         visited, and <code>false</code> if the children of this node should
1892     *         be skipped
1893     *
1894     * @since 3.10
1895     */
1896    public boolean visit(TypeMethodReference node) {
1897        return true;
1898    }
1899
1900    /**
1901     * Visits the given type-specific AST node.
1902     * <p>
1903     * The default implementation does nothing and return true.
1904     * Subclasses may reimplement.
1905     * </p>
1906     *
1907     * @param node the node to visit
1908     * @return <code>true</code> if the children of this node should be
1909     *         visited, and <code>false</code> if the children of this node should
1910     *         be skipped
1911     * @since 3.1
1912     */
1913    public boolean visit(TypeParameter node) {
1914        return true;
1915    }
1916
1917    /**
1918     * Visits the given type-specific AST node.
1919     * <p>
1920     * The default implementation does nothing and return true.
1921     * Subclasses may reimplement.
1922     * </p>
1923     *
1924     * @param node the node to visit
1925     * @return <code>true</code> if the children of this node should be
1926     *         visited, and <code>false</code> if the children of this node should
1927     *         be skipped
1928     * @since 3.28
1929     */
1930    public boolean visit(TypePattern node) {
1931        return true;
1932    }
1933
1934    /**
1935     * Visits the given type-specific AST node.
1936     * <p>
1937     * The default implementation does nothing and return true.
1938     * Subclasses may reimplement.
1939     * </p>
1940     *
1941     * @param node the node to visit
1942     * @return <code>true</code> if the children of this node should be
1943     *         visited, and <code>false</code> if the children of this node should
1944     *         be skipped
1945     * @since 3.7.1
1946     */
1947    public boolean visit(UnionType node) {
1948        return true;
1949    }
1950
1951    /**
1952     * Visits the given type-specific AST node.
1953     * <p>
1954     * The default implementation does nothing and return true.
1955     * Subclasses may re-implement.
1956     * </p>
1957     *
1958     * @param node the node to visit
1959     * @return <code>true</code> if the children of this node should be
1960     *         visited, and <code>false</code> if the children of this node should
1961     *         be skipped
1962     * @since 3.14
1963     */
1964    public boolean visit(UsesDirective node) {
1965        return true;
1966    }
1967
1968    /**
1969     * Visits the given type-specific AST node.
1970     * <p>
1971     * The default implementation does nothing and return true.
1972     * Subclasses may reimplement.
1973     * </p>
1974     *
1975     * @param node the node to visit
1976     * @return <code>true</code> if the children of this node should be
1977     *         visited, and <code>false</code> if the children of this node should
1978     *         be skipped
1979     */
1980    public boolean visit(VariableDeclarationExpression node) {
1981        return true;
1982    }
1983
1984    /**
1985     * Visits the given type-specific AST node.
1986     * <p>
1987     * The default implementation does nothing and return true.
1988     * Subclasses may reimplement.
1989     * </p>
1990     *
1991     * @param node the node to visit
1992     * @return <code>true</code> if the children of this node should be
1993     *         visited, and <code>false</code> if the children of this node should
1994     *         be skipped
1995     */
1996    public boolean visit(VariableDeclarationStatement node) {
1997        return true;
1998    }
1999
2000    /**
2001     * Visits the given type-specific AST node.
2002     * <p>
2003     * The default implementation does nothing and return true.
2004     * Subclasses may reimplement.
2005     * </p>
2006     *
2007     * @param node the node to visit
2008     * @return <code>true</code> if the children of this node should be
2009     *         visited, and <code>false</code> if the children of this node should
2010     *         be skipped
2011     */
2012    public boolean visit(VariableDeclarationFragment node) {
2013        return true;
2014    }
2015
2016    /**
2017     * Visits the given type-specific AST node.
2018     * <p>
2019     * The default implementation does nothing and return true.
2020     * Subclasses may reimplement.
2021     * </p>
2022     *
2023     * @param node the node to visit
2024     * @return <code>true</code> if the children of this node should be
2025     *         visited, and <code>false</code> if the children of this node should
2026     *         be skipped
2027     */
2028    public boolean visit(WhileStatement node) {
2029        return true;
2030    }
2031
2032    /**
2033     * Visits the given type-specific AST node.
2034     * <p>
2035     * The default implementation does nothing and return true.
2036     * Subclasses may reimplement.
2037     * </p>
2038     *
2039     * @param node the node to visit
2040     * @return <code>true</code> if the children of this node should be
2041     *         visited, and <code>false</code> if the children of this node should
2042     *         be skipped
2043     * @since 3.1
2044     */
2045    public boolean visit(WildcardType node) {
2046        return true;
2047    }
2048
2049    /**
2050     * Visits the given type-specific AST node.
2051     * <p>
2052     * The default implementation does nothing and returns true.
2053     * Subclasses may reimplement.
2054     * </p>
2055     *
2056     * @param node the node to visit
2057     * @return <code>true</code> if the children of this node should be
2058     *         visited, and <code>false</code> if the children of this node should
2059     *         be skipped
2060     * @since 3.24
2061     */
2062    public boolean visit(YieldStatement node) {
2063        return true;
2064    }
2065
2066    /**
2067     * End of visit the given type-specific AST node.
2068     * <p>
2069     * The default implementation does nothing. Subclasses may reimplement.
2070     * </p>
2071     *
2072     * @param node the node to visit
2073     * @since 3.1
2074     */
2075    public void endVisit(AnnotationTypeDeclaration node) {
2076        // default implementation: do nothing
2077    }
2078
2079    /**
2080     * End of visit the given type-specific AST node.
2081     * <p>
2082     * The default implementation does nothing. Subclasses may reimplement.
2083     * </p>
2084     *
2085     * @param node the node to visit
2086     * @since 3.1
2087     */
2088    public void endVisit(AnnotationTypeMemberDeclaration node) {
2089        // default implementation: do nothing
2090    }
2091
2092    /**
2093     * End of visit the given type-specific AST node.
2094     * <p>
2095     * The default implementation does nothing. Subclasses may reimplement.
2096     * </p>
2097     *
2098     * @param node the node to visit
2099     */
2100    public void endVisit(AnonymousClassDeclaration node) {
2101        // default implementation: do nothing
2102    }
2103
2104    /**
2105     * End of visit the given type-specific AST node.
2106     * <p>
2107     * The default implementation does nothing. Subclasses may reimplement.
2108     * </p>
2109     *
2110     * @param node the node to visit
2111     */
2112    public void endVisit(ArrayAccess node) {
2113        // default implementation: do nothing
2114    }
2115
2116    /**
2117     * End of visit the given type-specific AST node.
2118     * <p>
2119     * The default implementation does nothing. Subclasses may reimplement.
2120     * </p>
2121     *
2122     * @param node the node to visit
2123     */
2124    public void endVisit(ArrayCreation node) {
2125        // default implementation: do nothing
2126    }
2127
2128    /**
2129     * End of visit the given type-specific AST node.
2130     * <p>
2131     * The default implementation does nothing. Subclasses may reimplement.
2132     * </p>
2133     *
2134     * @param node the node to visit
2135     */
2136    public void endVisit(ArrayInitializer node) {
2137        // default implementation: do nothing
2138    }
2139
2140    /**
2141     * End of visit the given type-specific AST node.
2142     * <p>
2143     * The default implementation does nothing. Subclasses may reimplement.
2144     * </p>
2145     *
2146     * @param node the node to visit
2147     */
2148    public void endVisit(ArrayType node) {
2149        // default implementation: do nothing
2150    }
2151
2152    /**
2153     * End of visit the given type-specific AST node.
2154     * <p>
2155     * The default implementation does nothing. Subclasses may reimplement.
2156     * </p>
2157     *
2158     * @param node the node to visit
2159     */
2160    public void endVisit(AssertStatement node) {
2161        // default implementation: do nothing
2162    }
2163
2164    /**
2165     * End of visit the given type-specific AST node.
2166     * <p>
2167     * The default implementation does nothing. Subclasses may reimplement.
2168     * </p>
2169     *
2170     * @param node the node to visit
2171     */
2172    public void endVisit(Assignment node) {
2173        // default implementation: do nothing
2174    }
2175
2176    /**
2177     * End of visit the given type-specific AST node.
2178     * <p>
2179     * The default implementation does nothing. Subclasses may reimplement.
2180     * </p>
2181     *
2182     * @param node the node to visit
2183     */
2184    public void endVisit(Block node) {
2185        // default implementation: do nothing
2186    }
2187
2188    /**
2189     * End of visit the given type-specific AST node.
2190     * <p>
2191     * The default implementation does nothing. Subclasses may reimplement.
2192     * </p>
2193     * <p>
2194     * Note: {@link LineComment} and {@link BlockComment} nodes are
2195     * not considered part of main structure of the AST. This method will
2196     * only be called if a client goes out of their way to visit this
2197     * kind of node explicitly.
2198     * </p>
2199     *
2200     * @param node the node to visit
2201     * @since 3.0
2202     */
2203    public void endVisit(BlockComment node) {
2204        // default implementation: do nothing
2205    }
2206
2207    /**
2208     * End of visit the given type-specific AST node.
2209     * <p>
2210     * The default implementation does nothing. Subclasses may reimplement.
2211     * </p>
2212     *
2213     * @param node the node to visit
2214     */
2215    public void endVisit(BooleanLiteral node) {
2216        // default implementation: do nothing
2217    }
2218
2219    /**
2220     * End of visit the given type-specific AST node.
2221     * <p>
2222     * The default implementation does nothing. Subclasses may reimplement.
2223     * </p>
2224     *
2225     * @param node the node to visit
2226     */
2227    public void endVisit(BreakStatement node) {
2228        // default implementation: do nothing
2229    }
2230
2231    /**
2232     * End of visit the given type-specific AST node.
2233     * <p>
2234     * The default implementation does nothing. Subclasses may reimplement.
2235     * </p>
2236     *
2237     * @param node the node to visit
2238     * @since 3.28
2239     */
2240    public void endVisit(CaseDefaultExpression node) {
2241        // default implementation: do nothing
2242    }
2243
2244    /**
2245     * End of visit the given type-specific AST node.
2246     * <p>
2247     * The default implementation does nothing. Subclasses may reimplement.
2248     * </p>
2249     *
2250     * @param node the node to visit
2251     */
2252    public void endVisit(CastExpression node) {
2253        // default implementation: do nothing
2254    }
2255
2256    /**
2257     * End of visit the given type-specific AST node.
2258     * <p>
2259     * The default implementation does nothing. Subclasses may reimplement.
2260     * </p>
2261     *
2262     * @param node the node to visit
2263     */
2264    public void endVisit(CatchClause node) {
2265        // default implementation: do nothing
2266    }
2267
2268    /**
2269     * End of visit the given type-specific AST node.
2270     * <p>
2271     * The default implementation does nothing. Subclasses may reimplement.
2272     * </p>
2273     *
2274     * @param node the node to visit
2275     */
2276    public void endVisit(CharacterLiteral node) {
2277        // default implementation: do nothing
2278    }
2279
2280    /**
2281     * End of visit the given type-specific AST node.
2282     * <p>
2283     * The default implementation does nothing. Subclasses may reimplement.
2284     * </p>
2285     *
2286     * @param node the node to visit
2287     */
2288    public void endVisit(ClassInstanceCreation node) {
2289        // default implementation: do nothing
2290    }
2291
2292    /**
2293     * End of visit the given type-specific AST node.
2294     * <p>
2295     * The default implementation does nothing. Subclasses may reimplement.
2296     * </p>
2297     *
2298     * @param node the node to visit
2299     */
2300    public void endVisit(CompilationUnit node) {
2301        // default implementation: do nothing
2302    }
2303
2304    /**
2305     * End of visit the given type-specific AST node.
2306     * <p>
2307     * The default implementation does nothing. Subclasses may reimplement.
2308     * </p>
2309     *
2310     * @param node the node to visit
2311     */
2312    public void endVisit(ConditionalExpression node) {
2313        // default implementation: do nothing
2314    }
2315
2316    /**
2317     * End of visit the given type-specific AST node.
2318     * <p>
2319     * The default implementation does nothing. Subclasses may reimplement.
2320     * </p>
2321     *
2322     * @param node the node to visit
2323     */
2324    public void endVisit(ConstructorInvocation node) {
2325        // default implementation: do nothing
2326    }
2327
2328    /**
2329     * End of visit the given type-specific AST node.
2330     * <p>
2331     * The default implementation does nothing. Subclasses may reimplement.
2332     * </p>
2333     *
2334     * @param node the node to visit
2335     */
2336    public void endVisit(ContinueStatement node) {
2337        // default implementation: do nothing
2338    }
2339
2340    /**
2341     * End of visit the given type-specific AST node.
2342     * <p>
2343     * The default implementation does nothing. Subclasses may reimplement.
2344     * </p>
2345     *
2346     * @param node the node to visit
2347     * @since 3.10
2348     */
2349    public void endVisit(CreationReference node) {
2350        // default implementation: do nothing
2351    }
2352
2353    /**
2354     * End of visit the given type-specific AST node.
2355     * <p>
2356     * The default implementation does nothing. Subclasses may reimplement.
2357     * </p>
2358     *
2359     * @param node the node to visit
2360     */
2361    public void endVisit(DoStatement node) {
2362        // default implementation: do nothing
2363    }
2364
2365    /**
2366     * End of visit the given type-specific AST node.
2367     * <p>
2368     * The default implementation does nothing. Subclasses may reimplement.
2369     * </p>
2370     *
2371     * @param node the node to visit
2372     */
2373    public void endVisit(EmptyStatement node) {
2374        // default implementation: do nothing
2375    }
2376
2377    /**
2378     * End of visit the given type-specific AST node.
2379     * <p>
2380     * The default implementation does nothing. Subclasses may reimplement.
2381     * </p>
2382     *
2383     * @param node the node to visit
2384     * @since 3.1
2385     */
2386    public void endVisit(EnhancedForStatement node) {
2387        // default implementation: do nothing
2388    }
2389
2390    /**
2391     * End of visit the given type-specific AST node.
2392     * <p>
2393     * The default implementation does nothing. Subclasses may reimplement.
2394     * </p>
2395     *
2396     * @param node the node to visit
2397     * @since 3.1
2398     */
2399    public void endVisit(EnumConstantDeclaration node) {
2400        // default implementation: do nothing
2401    }
2402
2403    /**
2404     * End of visit the given type-specific AST node.
2405     * <p>
2406     * The default implementation does nothing. Subclasses may reimplement.
2407     * </p>
2408     *
2409     * @param node the node to visit
2410     * @since 3.1
2411     */
2412    public void endVisit(EnumDeclaration node) {
2413        // default implementation: do nothing
2414    }
2415
2416    /**
2417     * End of visit the given type-specific AST node.
2418     * <p>
2419     * The default implementation does nothing. Subclasses may reimplement.
2420     * </p>
2421     *
2422     * @param node the node to visit
2423     * @since 3.14
2424     */
2425    public void endVisit(ExportsDirective node) {
2426        // default implementation: do nothing
2427    }
2428
2429    /**
2430     * End of visit the given type-specific AST node.
2431     * <p>
2432     * The default implementation does nothing. Subclasses may reimplement.
2433     * </p>
2434     *
2435     * @param node the node to visit
2436     * @since 3.10
2437     */
2438    public void endVisit(ExpressionMethodReference node) {
2439        // default implementation: do nothing
2440    }
2441
2442    /**
2443     * End of visit the given type-specific AST node.
2444     * <p>
2445     * The default implementation does nothing. Subclasses may reimplement.
2446     * </p>
2447     *
2448     * @param node the node to visit
2449     */
2450    public void endVisit(ExpressionStatement node) {
2451        // default implementation: do nothing
2452    }
2453
2454    /**
2455     * End of visit the given type-specific AST node.
2456     * <p>
2457     * The default implementation does nothing. Subclasses may reimplement.
2458     * </p>
2459     *
2460     * @param node the node to visit
2461     * @since 3.10
2462     */
2463    public void endVisit(Dimension node) {
2464        // do nothing by default
2465    }
2466
2467    /**
2468     * End of visit the given type-specific AST node.
2469     * <p>
2470     * The default implementation does nothing. Subclasses may reimplement.
2471     * </p>
2472     *
2473     * @param node the node to visit
2474     */
2475    public void endVisit(FieldAccess node) {
2476        // default implementation: do nothing
2477    }
2478
2479    /**
2480     * End of visit the given type-specific AST node.
2481     * <p>
2482     * The default implementation does nothing. Subclasses may reimplement.
2483     * </p>
2484     *
2485     * @param node the node to visit
2486     */
2487    public void endVisit(FieldDeclaration node) {
2488        // default implementation: do nothing
2489    }
2490
2491    /**
2492     * End of visit the given type-specific AST node.
2493     * <p>
2494     * The default implementation does nothing. Subclasses may reimplement.
2495     * </p>
2496     *
2497     * @param node the node to visit
2498     */
2499    public void endVisit(ForStatement node) {
2500        // default implementation: do nothing
2501    }
2502
2503    /**
2504     * End of visit the given type-specific AST node.
2505     * <p>
2506     * The default implementation does nothing. Subclasses may reimplement.
2507     * </p>
2508     *
2509     * @param node the node to visit
2510     * @since 3.28
2511     */
2512    public void endVisit(GuardedPattern node) {
2513        // default implementation: do nothing
2514    }
2515
2516    /**
2517     * End of visit the given type-specific AST node.
2518     * <p>
2519     * The default implementation does nothing. Subclasses may reimplement.
2520     * </p>
2521     *
2522     * @param node the node to visit
2523     */
2524    public void endVisit(IfStatement node) {
2525        // default implementation: do nothing
2526    }
2527
2528    /**
2529     * End of visit the given type-specific AST node.
2530     * <p>
2531     * The default implementation does nothing. Subclasses may reimplement.
2532     * </p>
2533     *
2534     * @param node the node to visit
2535     */
2536    public void endVisit(ImportDeclaration node) {
2537        // default implementation: do nothing
2538    }
2539
2540    /**
2541     * End of visit the given type-specific AST node.
2542     * <p>
2543     * The default implementation does nothing. Subclasses may reimplement.
2544     * </p>
2545     *
2546     * @param node the node to visit
2547     */
2548    public void endVisit(InfixExpression node) {
2549        // default implementation: do nothing
2550    }
2551
2552    /**
2553     * End of visit the given type-specific AST node.
2554     * <p>
2555     * The default implementation does nothing. Subclasses may reimplement.
2556     * </p>
2557     *
2558     * @param node the node to visit
2559     */
2560    public void endVisit(InstanceofExpression node) {
2561        // default implementation: do nothing
2562    }
2563
2564    /**
2565     * End of visit the given type-specific AST node.
2566     * <p>
2567     * The default implementation does nothing. Subclasses may reimplement.
2568     * </p>
2569     *
2570     * @param node the node to visit
2571     */
2572    public void endVisit(Initializer node) {
2573        // default implementation: do nothing
2574    }
2575
2576    /**
2577     * End of visit the given type-specific AST node.
2578     * <p>
2579     * The default implementation does nothing. Subclasses may reimplement.
2580     * </p>
2581     *
2582     * @param node the node to visit
2583     */
2584    public void endVisit(Javadoc node) {
2585        // default implementation: do nothing
2586    }
2587
2588    /**
2589     * End of visit the given type-specific AST node.
2590     * <p>
2591     * The default implementation does nothing. Subclasses may reimplement.
2592     * </p>
2593     *
2594     * @param node the node to visit
2595     * @since 3.30
2596     */
2597    public void endVisit(JavaDocRegion node) {
2598        // default implementation: do nothing
2599    }
2600
2601    /**
2602     * End of visit the given type-specific AST node.
2603     * <p>
2604     * The default implementation does nothing. Subclasses may reimplement.
2605     * </p>
2606     *
2607     * @param node the node to visit
2608     */
2609    public void endVisit(LabeledStatement node) {
2610        // default implementation: do nothing
2611    }
2612
2613    /**
2614     * End of visit the given type-specific AST node.
2615     * <p>
2616     * The default implementation does nothing. Subclasses may reimplement.
2617     * </p>
2618     *
2619     * @param node the node to visit
2620     * @since 3.10
2621     */
2622    public void endVisit(LambdaExpression node) {
2623        // default implementation: do nothing
2624    }
2625
2626    /**
2627     * End of visit the given type-specific AST node.
2628     * <p>
2629     * The default implementation does nothing. Subclasses may reimplement.
2630     * </p>
2631     * <p>
2632     * Note: {@link LineComment} and {@link BlockComment} nodes are
2633     * not considered part of main structure of the AST. This method will
2634     * only be called if a client goes out of their way to visit this
2635     * kind of node explicitly.
2636     * </p>
2637     *
2638     * @param node the node to visit
2639     * @since 3.0
2640     */
2641    public void endVisit(LineComment node) {
2642        // default implementation: do nothing
2643    }
2644
2645    /**
2646     * End of visit the given type-specific AST node.
2647     * <p>
2648     * The default implementation does nothing. Subclasses may reimplement.
2649     * </p>
2650     *
2651     * @param node the node to visit
2652     * @since 3.1
2653     */
2654    public void endVisit(MarkerAnnotation node) {
2655        // default implementation: do nothing
2656    }
2657
2658    /**
2659     * End of visit the given type-specific AST node.
2660     * <p>
2661     * The default implementation does nothing. Subclasses may reimplement.
2662     * </p>
2663     *
2664     * @param node the node to visit
2665     * @since 3.0
2666     */
2667    public void endVisit(MemberRef node) {
2668        // default implementation: do nothing
2669    }
2670
2671    /**
2672     * End of visit the given type-specific AST node.
2673     * <p>
2674     * The default implementation does nothing. Subclasses may reimplement.
2675     * </p>
2676     *
2677     * @param node the node to visit
2678     * @since 3.1
2679     */
2680    public void endVisit(MemberValuePair node) {
2681        // default implementation: do nothing
2682    }
2683
2684    /**
2685     * End of visit the given type-specific AST node.
2686     * <p>
2687     * The default implementation does nothing. Subclasses may reimplement.
2688     * </p>
2689     *
2690     * @param node the node to visit
2691     * @since 3.0
2692     */
2693    public void endVisit(MethodRef node) {
2694        // default implementation: do nothing
2695    }
2696
2697    /**
2698     * End of visit the given type-specific AST node.
2699     * <p>
2700     * The default implementation does nothing. Subclasses may reimplement.
2701     * </p>
2702     *
2703     * @param node the node to visit
2704     * @since 3.0
2705     */
2706    public void endVisit(MethodRefParameter node) {
2707        // default implementation: do nothing
2708    }
2709
2710    /**
2711     * End of visit the given type-specific AST node.
2712     * <p>
2713     * The default implementation does nothing. Subclasses may reimplement.
2714     * </p>
2715     *
2716     * @param node the node to visit
2717     */
2718    public void endVisit(MethodDeclaration node) {
2719        // default implementation: do nothing
2720    }
2721
2722    /**
2723     * End of visit the given type-specific AST node.
2724     * <p>
2725     * The default implementation does nothing. Subclasses may reimplement.
2726     * </p>
2727     *
2728     * @param node the node to visit
2729     */
2730    public void endVisit(MethodInvocation node) {
2731        // default implementation: do nothing
2732    }
2733
2734    /**
2735     * End of visit the given type-specific AST node.
2736     * <p>
2737     * The default implementation does nothing. Subclasses may reimplement.
2738     * </p>
2739     *
2740     * @param node the node to visit
2741     * @since 3.1
2742     */
2743    public void endVisit(Modifier node) {
2744        // default implementation: do nothing
2745    }
2746
2747    /**
2748     * End of visit the given type-specific AST node.
2749     * <p>
2750     * The default implementation does nothing. Subclasses may reimplement.
2751     * </p>
2752     *
2753     * @param node the node to visit
2754     * @since 3.14
2755     */
2756    public void endVisit(ModuleDeclaration node) {
2757        // default implementation: do nothing
2758    }
2759
2760    /**
2761     * End of visit the given type-specific AST node.
2762     * <p>
2763     * The default implementation does nothing. Subclasses may reimplement.
2764     * </p>
2765     *
2766     * @param node the node to visit
2767     * @since 3.14
2768     */
2769    public void endVisit(ModuleModifier node) {
2770        // default implementation: do nothing
2771    }
2772
2773    /**
2774     * End of visit the given type-specific AST node.
2775     * <p>
2776     * The default implementation does nothing. Subclasses may reimplement.
2777     * </p>
2778     *
2779     * @param node the node to visit
2780     * @since 3.10
2781     */
2782    public void endVisit(NameQualifiedType node) {
2783        // default implementation: do nothing
2784    }
2785
2786    /**
2787     * End of visit the given type-specific AST node.
2788     * <p>
2789     * The default implementation does nothing. Subclasses may reimplement.
2790     * </p>
2791     *
2792     * @param node the node to visit
2793     * @since 3.1
2794     */
2795    public void endVisit(NormalAnnotation node) {
2796        // default implementation: do nothing
2797    }
2798
2799    /**
2800     * End of visit the given type-specific AST node.
2801     * <p>
2802     * The default implementation does nothing. Subclasses may reimplement.
2803     * </p>
2804     *
2805     * @param node the node to visit
2806     */
2807    public void endVisit(NullLiteral node) {
2808        // default implementation: do nothing
2809    }
2810
2811    /**
2812     * End of visit the given type-specific AST node.
2813     * <p>
2814     * The default implementation does nothing. Subclasses may reimplement.
2815     * </p>
2816     *
2817     * @param node the node to visit
2818     * @since 3.28
2819     */
2820    public void endVisit(NullPattern node) {
2821        // default implementation: do nothing
2822    }
2823
2824    /**
2825     * End of visit the given type-specific AST node.
2826     * <p>
2827     * The default implementation does nothing. Subclasses may reimplement.
2828     * </p>
2829     *
2830     * @param node the node to visit
2831     */
2832    public void endVisit(NumberLiteral node) {
2833        // default implementation: do nothing
2834    }
2835
2836    /**
2837     * End of visit the given type-specific AST node.
2838     * <p>
2839     * The default implementation does nothing. Subclasses may reimplement.
2840     * </p>
2841     *
2842     * @param node the node to visit
2843     * @since 3.14
2844     */
2845    public void endVisit(OpensDirective node) {
2846        // default implementation: do nothing
2847    }
2848
2849    /**
2850     * End of visit the given type-specific AST node.
2851     * <p>
2852     * The default implementation does nothing. Subclasses may reimplement.
2853     * </p>
2854     *
2855     * @param node the node to visit
2856     */
2857    public void endVisit(PackageDeclaration node) {
2858        // default implementation: do nothing
2859    }
2860
2861    /**
2862     * End of visit the given type-specific AST node.
2863     * <p>
2864     * The default implementation does nothing. Subclasses may reimplement.
2865     * </p>
2866     *
2867     * @param node the node to visit
2868     * @since 3.1
2869     */
2870    public void endVisit(ParameterizedType node) {
2871        // default implementation: do nothing
2872    }
2873
2874    /**
2875     * End of visit the given type-specific AST node.
2876     * <p>
2877     * The default implementation does nothing. Subclasses may reimplement.
2878     * </p>
2879     *
2880     * @param node the node to visit
2881     */
2882    public void endVisit(ParenthesizedExpression node) {
2883        // default implementation: do nothing
2884    }
2885
2886    /**
2887     * End of visit the given type-specific AST node.
2888     * <p>
2889     * The default implementation does nothing. Subclasses may reimplement.
2890     * </p>
2891     *
2892     * @param node the node to visit
2893     * @since 3.26
2894     */
2895    public void endVisit(PatternInstanceofExpression node) {
2896        // default implementation: do nothing
2897    }
2898
2899    /**
2900     * End of visit the given type-specific AST node.
2901     * <p>
2902     * The default implementation does nothing. Subclasses may reimplement.
2903     * </p>
2904     *
2905     * @param node the node to visit
2906     */
2907    public void endVisit(PostfixExpression node) {
2908        // default implementation: do nothing
2909    }
2910
2911    /**
2912     * End of visit the given type-specific AST node.
2913     * <p>
2914     * The default implementation does nothing. Subclasses may reimplement.
2915     * </p>
2916     *
2917     * @param node the node to visit
2918     */
2919    public void endVisit(PrefixExpression node) {
2920        // default implementation: do nothing
2921    }
2922
2923    /**
2924     * End of visit the given type-specific AST node.
2925     * <p>
2926     * The default implementation does nothing. Subclasses may reimplement.
2927     * </p>
2928     *
2929     * @param node the node to visit
2930     */
2931    public void endVisit(PrimitiveType node) {
2932        // default implementation: do nothing
2933    }
2934
2935    /**
2936     * End of visit the given type-specific AST node.
2937     * <p>
2938     * The default implementation does nothing. Subclasses may reimplement.
2939     * </p>
2940     *
2941     * @param node the node to visit
2942     * @since 3.14
2943     */
2944    public void endVisit(ProvidesDirective node) {
2945        // default implementation: do nothing
2946    }
2947
2948    /**
2949     * End of visit the given type-specific AST node.
2950     * <p>
2951     * The default implementation does nothing. Subclasses may reimplement.
2952     * </p>
2953     *
2954     * @param node the node to visit
2955     */
2956    public void endVisit(QualifiedName node) {
2957        // default implementation: do nothing
2958    }
2959
2960    /**
2961     * End of visit the given type-specific AST node.
2962     * <p>
2963     * The default implementation does nothing. Subclasses may reimplement.
2964     * </p>
2965     *
2966     * @param node the node to visit
2967     * @since 3.1
2968     */
2969    public void endVisit(QualifiedType node) {
2970        // default implementation: do nothing
2971    }
2972
2973    /**
2974     * End of visit the given type-specific AST node.
2975     * <p>
2976     * The default implementation does nothing. Subclasses may reimplement.
2977     * </p>
2978     *
2979     * @param node the node to visit
2980     * @noreference
2981     */
2982    public void endVisit(ModuleQualifiedName node) {
2983        // default implementation: do nothing
2984    }
2985
2986    /**
2987     * End of visit the given type-specific AST node.
2988     * <p>
2989     * The default implementation does nothing. Subclasses may reimplement.
2990     * </p>
2991     *
2992     * @param node the node to visit
2993     * @since 3.14
2994     */
2995    public void endVisit(RequiresDirective node) {
2996        // default implementation: do nothing
2997    }
2998
2999    /**
3000     * End of visit the given type-specific AST node.
3001     * <p>
3002     * The default implementation does nothing. Subclasses may re implement.
3003     * </p>
3004     *
3005     * @param node the node to visit
3006     * @since 3.22
3007     * @noreference This method is not intended to be referenced by clients.
3008     */
3009    public void endVisit(RecordDeclaration node) {
3010        // default implementation: do nothing
3011    }
3012
3013    /**
3014     * End of visit the given type-specific AST node.
3015     * <p>
3016     * The default implementation does nothing. Subclasses may reimplement.
3017     * </p>
3018     *
3019     * @param node the node to visit
3020     */
3021    public void endVisit(ReturnStatement node) {
3022        // default implementation: do nothing
3023    }
3024
3025    /**
3026     * End of visit the given type-specific AST node.
3027     * <p>
3028     * The default implementation does nothing. Subclasses may reimplement.
3029     * </p>
3030     *
3031     * @param node the node to visit
3032     */
3033    public void endVisit(SimpleName node) {
3034        // default implementation: do nothing
3035    }
3036
3037    /**
3038     * End of visit the given type-specific AST node.
3039     * <p>
3040     * The default implementation does nothing. Subclasses may reimplement.
3041     * </p>
3042     *
3043     * @param node the node to visit
3044     */
3045    public void endVisit(SimpleType node) {
3046        // default implementation: do nothing
3047    }
3048
3049    /**
3050     * End of visit the given type-specific AST node.
3051     * <p>
3052     * The default implementation does nothing. Subclasses may reimplement.
3053     * </p>
3054     *
3055     * @param node the node to visit
3056     * @since 3.1
3057     */
3058    public void endVisit(SingleMemberAnnotation node) {
3059        // default implementation: do nothing
3060    }
3061
3062    /**
3063     * End of visit the given type-specific AST node.
3064     * <p>
3065     * The default implementation does nothing. Subclasses may reimplement.
3066     * </p>
3067     *
3068     * @param node the node to visit
3069     */
3070    public void endVisit(SingleVariableDeclaration node) {
3071        // default implementation: do nothing
3072    }
3073
3074    /**
3075     * End of visit the given type-specific AST node.
3076     * <p>
3077     * The default implementation does nothing. Subclasses may reimplement.
3078     * </p>
3079     *
3080     * @param node the node to visit
3081     */
3082    public void endVisit(StringLiteral node) {
3083        // default implementation: do nothing
3084    }
3085
3086    /**
3087     * End of visit the given type-specific AST node.
3088     * <p>
3089     * The default implementation does nothing. Subclasses may reimplement.
3090     * </p>
3091     *
3092     * @param node the node to visit
3093     */
3094    public void endVisit(SuperConstructorInvocation node) {
3095        // default implementation: do nothing
3096    }
3097
3098    /**
3099     * End of visit the given type-specific AST node.
3100     * <p>
3101     * The default implementation does nothing. Subclasses may reimplement.
3102     * </p>
3103     *
3104     * @param node the node to visit
3105     */
3106    public void endVisit(SuperFieldAccess node) {
3107        // default implementation: do nothing
3108    }
3109
3110    /**
3111     * End of visit the given type-specific AST node.
3112     * <p>
3113     * The default implementation does nothing. Subclasses may reimplement.
3114     * </p>
3115     *
3116     * @param node the node to visit
3117     */
3118    public void endVisit(SuperMethodInvocation node) {
3119        // default implementation: do nothing
3120    }
3121
3122    /**
3123     * End of visit the given type-specific AST node.
3124     * <p>
3125     * The default implementation does nothing. Subclasses may reimplement.
3126     * </p>
3127     *
3128     * @param node the node to visit
3129     * @since 3.10
3130     */
3131    public void endVisit(SuperMethodReference node) {
3132        // default implementation: do nothing
3133    }
3134
3135    /**
3136     * End of visit the given type-specific AST node.
3137     * <p>
3138     * The default implementation does nothing. Subclasses may reimplement.
3139     * </p>
3140     *
3141     * @param node the node to visit
3142     */
3143    public void endVisit(SwitchCase node) {
3144        // default implementation: do nothing
3145    }
3146
3147    /**
3148     * End of visit the given type-specific AST node.
3149     * <p>
3150     * The default implementation does nothing. Subclasses may reimplement.
3151     * </p>
3152     *
3153     * @param node the node to visit
3154     * @since 3.18
3155     */
3156    public void endVisit(SwitchExpression node) {
3157        // default implementation: do nothing
3158    }
3159
3160    /**
3161     * End of visit the given type-specific AST node.
3162     * <p>
3163     * The default implementation does nothing. Subclasses may reimplement.
3164     * </p>
3165     *
3166     * @param node the node to visit
3167     */
3168    public void endVisit(SwitchStatement node) {
3169        // default implementation: do nothing
3170    }
3171
3172    /**
3173     * End of visit the given type-specific AST node.
3174     * <p>
3175     * The default implementation does nothing. Subclasses may reimplement.
3176     * </p>
3177     *
3178     * @param node the node to visit
3179     */
3180    public void endVisit(SynchronizedStatement node) {
3181        // default implementation: do nothing
3182    }
3183
3184    /**
3185     * End of visit the given type-specific AST node.
3186     * <p>
3187     * The default implementation does nothing. Subclasses may reimplement.
3188     * </p>
3189     *
3190     * @param node the node to visit
3191     * @since 3.0
3192     */
3193    public void endVisit(TagElement node) {
3194        // default implementation: do nothing
3195    }
3196
3197    /**
3198     * End of visit the given type-specific AST node.
3199     * <p>
3200     * The default implementation does nothing. Subclasses may reimplement.
3201     * </p>
3202     *
3203     * @param node the node to visit
3204     * @since 3.30
3205     */
3206    public void endVisit(TagProperty node) {
3207        // default implementation: do nothing
3208    }
3209
3210    /**
3211     * End of visit the given type-specific AST node.
3212     * <p>
3213     * The default implementation does nothing. Subclasses may reimplement.
3214     * </p>
3215     *
3216     * @param node the node to visit
3217     * @since 3.24
3218     */
3219    public void endVisit(TextBlock node) {
3220        // default implementation: do nothing
3221    }
3222
3223    /**
3224     * End of visit the given type-specific AST node.
3225     * <p>
3226     * The default implementation does nothing. Subclasses may reimplement.
3227     * </p>
3228     *
3229     * @param node the node to visit
3230     * @since 3.0
3231     */
3232    public void endVisit(TextElement node) {
3233        // default implementation: do nothing
3234    }
3235
3236    /**
3237     * End of visit the given type-specific AST node.
3238     * <p>
3239     * The default implementation does nothing. Subclasses may reimplement.
3240     * </p>
3241     *
3242     * @param node the node to visit
3243     */
3244    public void endVisit(ThisExpression node) {
3245        // default implementation: do nothing
3246    }
3247
3248    /**
3249     * End of visit the given type-specific AST node.
3250     * <p>
3251     * The default implementation does nothing. Subclasses may reimplement.
3252     * </p>
3253     *
3254     * @param node the node to visit
3255     */
3256    public void endVisit(ThrowStatement node) {
3257        // default implementation: do nothing
3258    }
3259
3260    /**
3261     * End of visit the given type-specific AST node.
3262     * <p>
3263     * The default implementation does nothing. Subclasses may reimplement.
3264     * </p>
3265     *
3266     * @param node the node to visit
3267     */
3268    public void endVisit(TryStatement node) {
3269        // default implementation: do nothing
3270    }
3271
3272    /**
3273     * End of visit the given type-specific AST node.
3274     * <p>
3275     * The default implementation does nothing. Subclasses may reimplement.
3276     * </p>
3277     *
3278     * @param node the node to visit
3279     */
3280    public void endVisit(TypeDeclaration node) {
3281        // default implementation: do nothing
3282    }
3283
3284    /**
3285     * End of visit the given type-specific AST node.
3286     * <p>
3287     * The default implementation does nothing. Subclasses may reimplement.
3288     * </p>
3289     *
3290     * @param node the node to visit
3291     */
3292    public void endVisit(TypeDeclarationStatement node) {
3293        // default implementation: do nothing
3294    }
3295
3296    /**
3297     * End of visit the given type-specific AST node.
3298     * <p>
3299     * The default implementation does nothing. Subclasses may reimplement.
3300     * </p>
3301     *
3302     * @param node the node to visit
3303     */
3304    public void endVisit(TypeLiteral node) {
3305        // default implementation: do nothing
3306    }
3307
3308    /**
3309     * End of visit the given type-specific AST node.
3310     * <p>
3311     * The default implementation does nothing. Subclasses may reimplement.
3312     * </p>
3313     *
3314     * @param node the node to visit
3315     *
3316     * @since 3.10
3317     */
3318    public void endVisit(TypeMethodReference node) {
3319        // default implementation: do nothing
3320    }
3321
3322    /**
3323     * End of visit the given type-specific AST node.
3324     * <p>
3325     * The default implementation does nothing. Subclasses may reimplement.
3326     * </p>
3327     *
3328     * @param node the node to visit
3329     * @since 3.1
3330     */
3331    public void endVisit(TypeParameter node) {
3332        // default implementation: do nothing
3333    }
3334
3335    /**
3336     * End of visit the given type-specific AST node.
3337     * <p>
3338     * The default implementation does nothing. Subclasses may reimplement.
3339     * </p>
3340     *
3341     * @param node the node to visit
3342     * @since 3.28
3343     */
3344    public void endVisit(TypePattern node) {
3345        // default implementation: do nothing
3346    }
3347
3348    /**
3349     * End of visit the given type-specific AST node.
3350     * <p>
3351     * The default implementation does nothing. Subclasses may reimplement.
3352     * </p>
3353     *
3354     * @param node the node to visit
3355     * @since 3.7.1
3356     */
3357    public void endVisit(UnionType node) {
3358        // default implementation: do nothing
3359    }
3360
3361    /**
3362     * End of visit the given type-specific AST node.
3363     * <p>
3364     * The default implementation does nothing. Subclasses may reimplement.
3365     * </p>
3366     *
3367     * @param node the node to visit
3368     * @since 3.14
3369     */
3370    public void endVisit(UsesDirective node) {
3371        // default implementation: do nothing
3372    }
3373
3374    /**
3375     * End of visit the given type-specific AST node.
3376     * <p>
3377     * The default implementation does nothing. Subclasses may reimplement.
3378     * </p>
3379     *
3380     * @param node the node to visit
3381     * @since 3.10
3382     */
3383    public void endVisit(IntersectionType node) {
3384        // default implementation: do nothing
3385    }
3386
3387    /**
3388     * End of visit the given type-specific AST node.
3389     * <p>
3390     * The default implementation does nothing. Subclasses may reimplement.
3391     * </p>
3392     *
3393     * @param node the node to visit
3394     */
3395    public void endVisit(VariableDeclarationExpression node) {
3396        // default implementation: do nothing
3397    }
3398
3399    /**
3400     * End of visit the given type-specific AST node.
3401     * <p>
3402     * The default implementation does nothing. Subclasses may reimplement.
3403     * </p>
3404     *
3405     * @param node the node to visit
3406     */
3407    public void endVisit(VariableDeclarationStatement node) {
3408        // default implementation: do nothing
3409    }
3410
3411    /**
3412     * End of visit the given type-specific AST node.
3413     * <p>
3414     * The default implementation does nothing. Subclasses may reimplement.
3415     * </p>
3416     *
3417     * @param node the node to visit
3418     */
3419    public void endVisit(VariableDeclarationFragment node) {
3420        // default implementation: do nothing
3421    }
3422
3423    /**
3424     * End of visit the given type-specific AST node.
3425     * <p>
3426     * The default implementation does nothing. Subclasses may reimplement.
3427     * </p>
3428     *
3429     * @param node the node to visit
3430     */
3431    public void endVisit(WhileStatement node) {
3432        // default implementation: do nothing
3433    }
3434
3435    /**
3436     * End of visit the given type-specific AST node.
3437     * <p>
3438     * The default implementation does nothing. Subclasses may reimplement.
3439     * </p>
3440     *
3441     * @param node the node to visit
3442     * @since 3.1
3443     */
3444    public void endVisit(WildcardType node) {
3445        // default implementation: do nothing
3446    }
3447
3448    /**
3449     * End of visit the given type-specific AST node.
3450     * <p>
3451     * The default implementation does nothing. Subclasses may reimplement.
3452     * </p>
3453     *
3454     * @param node the node to visit
3455     * @since 3.24
3456     */
3457    public void endVisit(YieldStatement node) {
3458        // default implementation: do nothing
3459    }
3460}
3461
MembersX
ASTVisitor:topScope
ASTVisitor:scopeStack
ASTVisitor:visitDocTags
ASTVisitor:popScope
ASTVisitor:getScope
ASTVisitor:postVisit
ASTVisitor:preVisit
ASTVisitor:currentScope
ASTVisitor:preVisit2
ASTVisitor:ASTVisitor
ASTVisitor:endVisit
ASTVisitor:pushScope
ASTVisitor:visit
Members
X