1 /*
   2  * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.source.util;
  27 
  28 import com.sun.source.tree.*;
  29 import jdk.internal.javac.PreviewFeature;
  30 
  31 /**
  32  * A simple visitor for tree nodes.
  33  *
  34  * @param <R> the return type of this visitor's methods.  Use {@link
  35  *            Void} for visitors that do not need to return results.
  36  * @param <P> the type of the additional parameter to this visitor's
  37  *            methods.  Use {@code Void} for visitors that do not need an
  38  *            additional parameter.
  39  *
  40  * @author Peter von der Ah&eacute;
  41  * @since 1.6
  42  */
  43 public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> {
  44     /**
  45      * The default value, returned by the {@link #defaultAction default action}.
  46      */
  47     protected final R DEFAULT_VALUE;
  48 
  49     /**
  50      * Creates a visitor, with a DEFAULT_VALUE of {@code null}.
  51      */
  52     protected SimpleTreeVisitor() {
  53         DEFAULT_VALUE = null;
  54     }
  55 
  56     /**
  57      * Creates a visitor, with a specified DEFAULT_VALUE.
  58      * @param defaultValue the default value to be returned by the default action
  59      */
  60     protected SimpleTreeVisitor(R defaultValue) {
  61         DEFAULT_VALUE = defaultValue;
  62     }
  63 
  64     /**
  65      * The default action, used by all visit methods that are not overridden.
  66      * @param node the node being visited
  67      * @param p the parameter value passed to the visit method
  68      * @return the result value to be returned from the visit method
  69      */
  70     protected R defaultAction(Tree node, P p) {
  71         return DEFAULT_VALUE;
  72     }
  73 
  74     /**
  75      * Invokes the appropriate visit method specific to the type of the node.
  76      * @param node the node on which to dispatch
  77      * @param p a parameter to be passed to the appropriate visit method
  78      * @return the value returns from the appropriate visit method
  79      */
  80     public final R visit(Tree node, P p) {
  81         return (node == null) ? null : node.accept(this, p);
  82     }
  83 
  84     /**
  85      * Invokes the appropriate visit method on each of a sequence of nodes.
  86      * @param nodes the nodes on which to dispatch
  87      * @param p a parameter value to be passed to each appropriate visit method
  88      * @return the value return from the last of the visit methods, or null
  89      *      if none were called
  90      */
  91     public final R visit(Iterable<? extends Tree> nodes, P p) {
  92         R r = null;
  93         if (nodes != null)
  94             for (Tree node : nodes)
  95                 r = visit(node, p);
  96         return r;
  97     }
  98 
  99     /**
 100      * {@inheritDoc}
 101      *
 102      * @implSpec This implementation calls {@code defaultAction}.
 103      *
 104      * @param node {@inheritDoc}
 105      * @param p {@inheritDoc}
 106      * @return  the result of {@code defaultAction}
 107      */
 108     @Override
 109     public R visitCompilationUnit(CompilationUnitTree node, P p) {
 110         return defaultAction(node, p);
 111     }
 112 
 113     /**
 114      * {@inheritDoc}
 115      *
 116      * @implSpec This implementation calls {@code defaultAction}.
 117      *
 118      * @param node {@inheritDoc}
 119      * @param p {@inheritDoc}
 120      * @return  the result of {@code defaultAction}
 121      */
 122     @Override
 123     public R visitPackage(PackageTree node, P p) {
 124         return defaultAction(node, p);
 125     }
 126 
 127     /**
 128      * {@inheritDoc}
 129      *
 130      * @implSpec This implementation calls {@code defaultAction}.
 131      *
 132      * @param node {@inheritDoc}
 133      * @param p {@inheritDoc}
 134      * @return  the result of {@code defaultAction}
 135      */
 136     @Override
 137     public R visitImport(ImportTree node, P p) {
 138         return defaultAction(node, p);
 139     }
 140 
 141     /**
 142      * {@inheritDoc}
 143      *
 144      * @implSpec This implementation calls {@code defaultAction}.
 145      *
 146      * @param node {@inheritDoc}
 147      * @param p {@inheritDoc}
 148      * @return  the result of {@code defaultAction}
 149      */
 150     @Override
 151     public R visitClass(ClassTree node, P p) {
 152         return defaultAction(node, p);
 153     }
 154 
 155     /**
 156      * {@inheritDoc}
 157      *
 158      * @implSpec This implementation calls {@code defaultAction}.
 159      *
 160      * @param node {@inheritDoc}
 161      * @param p {@inheritDoc}
 162      * @return  the result of {@code defaultAction}
 163      */
 164     @Override
 165     public R visitMethod(MethodTree node, P p) {
 166         return defaultAction(node, p);
 167     }
 168 
 169     /**
 170      * {@inheritDoc}
 171      *
 172      * @implSpec This implementation calls {@code defaultAction}.
 173      *
 174      * @param node {@inheritDoc}
 175      * @param p {@inheritDoc}
 176      * @return  the result of {@code defaultAction}
 177      */
 178     @Override
 179     public R visitVariable(VariableTree node, P p) {
 180         return defaultAction(node, p);
 181     }
 182 
 183     /**
 184      * {@inheritDoc}
 185      *
 186      * @implSpec This implementation calls {@code defaultAction}.
 187      *
 188      * @param node {@inheritDoc}
 189      * @param p {@inheritDoc}
 190      * @return  the result of {@code defaultAction}
 191      */
 192     @Override
 193     public R visitEmptyStatement(EmptyStatementTree node, P p) {
 194         return defaultAction(node, p);
 195     }
 196 
 197     /**
 198      * {@inheritDoc}
 199      *
 200      * @implSpec This implementation calls {@code defaultAction}.
 201      *
 202      * @param node {@inheritDoc}
 203      * @param p {@inheritDoc}
 204      * @return  the result of {@code defaultAction}
 205      */
 206     @Override
 207     public R visitBlock(BlockTree node, P p) {
 208         return defaultAction(node, p);
 209     }
 210 
 211     /**
 212      * {@inheritDoc}
 213      *
 214      * @implSpec This implementation calls {@code defaultAction}.
 215      *
 216      * @param node {@inheritDoc}
 217      * @param p {@inheritDoc}
 218      * @return  the result of {@code defaultAction}
 219      */
 220     @Override
 221     public R visitDoWhileLoop(DoWhileLoopTree node, P p) {
 222         return defaultAction(node, p);
 223     }
 224 
 225     /**
 226      * {@inheritDoc}
 227      *
 228      * @implSpec This implementation calls {@code defaultAction}.
 229      *
 230      * @param node {@inheritDoc}
 231      * @param p {@inheritDoc}
 232      * @return  the result of {@code defaultAction}
 233      */
 234     @Override
 235     public R visitWhileLoop(WhileLoopTree node, P p) {
 236         return defaultAction(node, p);
 237     }
 238 
 239     /**
 240      * {@inheritDoc}
 241      *
 242      * @implSpec This implementation calls {@code defaultAction}.
 243      *
 244      * @param node {@inheritDoc}
 245      * @param p {@inheritDoc}
 246      * @return  the result of {@code defaultAction}
 247      */
 248     @Override
 249     public R visitForLoop(ForLoopTree node, P p) {
 250         return defaultAction(node, p);
 251     }
 252 
 253     /**
 254      * {@inheritDoc}
 255      *
 256      * @implSpec This implementation calls {@code defaultAction}.
 257      *
 258      * @param node {@inheritDoc}
 259      * @param p {@inheritDoc}
 260      * @return  the result of {@code defaultAction}
 261      */
 262     @Override
 263     public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) {
 264         return defaultAction(node, p);
 265     }
 266 
 267     /**
 268      * {@inheritDoc}
 269      *
 270      * @implSpec This implementation calls {@code defaultAction}.
 271      *
 272      * @param node {@inheritDoc}
 273      * @param p {@inheritDoc}
 274      * @return  the result of {@code defaultAction}
 275      */
 276     @Override
 277     public R visitLabeledStatement(LabeledStatementTree node, P p) {
 278         return defaultAction(node, p);
 279     }
 280 
 281     /**
 282      * {@inheritDoc}
 283      *
 284      * @implSpec This implementation calls {@code defaultAction}.
 285      *
 286      * @param node {@inheritDoc}
 287      * @param p {@inheritDoc}
 288      * @return  the result of {@code defaultAction}
 289      */
 290     @Override
 291     public R visitSwitch(SwitchTree node, P p) {
 292         return defaultAction(node, p);
 293     }
 294 
 295     /**
 296      * {@inheritDoc}
 297      *
 298      * @implSpec This implementation calls {@code defaultAction}.
 299      *
 300      * @param node {@inheritDoc}
 301      * @param p {@inheritDoc}
 302      * @return  the result of {@code defaultAction}
 303      */
 304     @Override
 305     public R visitSwitchExpression(SwitchExpressionTree node, P p) {
 306         return defaultAction(node, p);
 307     }
 308 
 309     /**
 310      * {@inheritDoc}
 311      *
 312      * @implSpec This implementation calls {@code defaultAction}.
 313      *
 314      * @param node {@inheritDoc}
 315      * @param p {@inheritDoc}
 316      * @return  the result of {@code defaultAction}
 317      */
 318     @Override
 319     public R visitCase(CaseTree node, P p) {
 320         return defaultAction(node, p);
 321     }
 322 
 323     /**
 324      * {@inheritDoc}
 325      *
 326      * @implSpec This implementation calls {@code defaultAction}.
 327      *
 328      * @param node {@inheritDoc}
 329      * @param p {@inheritDoc}
 330      * @return  the result of {@code defaultAction}
 331      */
 332     @Override
 333     public R visitSynchronized(SynchronizedTree node, P p) {
 334         return defaultAction(node, p);
 335     }
 336 
 337     /**
 338      * {@inheritDoc}
 339      *
 340      * @implSpec This implementation calls {@code defaultAction}.
 341      *
 342      * @param node {@inheritDoc}
 343      * @param p {@inheritDoc}
 344      * @return  the result of {@code defaultAction}
 345      */
 346     @Override
 347     public R visitTry(TryTree node, P p) {
 348         return defaultAction(node, p);
 349     }
 350 
 351     /**
 352      * {@inheritDoc}
 353      *
 354      * @implSpec This implementation calls {@code defaultAction}.
 355      *
 356      * @param node {@inheritDoc}
 357      * @param p {@inheritDoc}
 358      * @return  the result of {@code defaultAction}
 359      */
 360     @Override
 361     public R visitCatch(CatchTree node, P p) {
 362         return defaultAction(node, p);
 363     }
 364 
 365     /**
 366      * {@inheritDoc}
 367      *
 368      * @implSpec This implementation calls {@code defaultAction}.
 369      *
 370      * @param node {@inheritDoc}
 371      * @param p {@inheritDoc}
 372      * @return  the result of {@code defaultAction}
 373      */
 374     @Override
 375     public R visitConditionalExpression(ConditionalExpressionTree node, P p) {
 376         return defaultAction(node, p);
 377     }
 378 
 379     /**
 380      * {@inheritDoc}
 381      *
 382      * @implSpec This implementation calls {@code defaultAction}.
 383      *
 384      * @param node {@inheritDoc}
 385      * @param p {@inheritDoc}
 386      * @return  the result of {@code defaultAction}
 387      */
 388     @Override
 389     public R visitIf(IfTree node, P p) {
 390         return defaultAction(node, p);
 391     }
 392 
 393     /**
 394      * {@inheritDoc}
 395      *
 396      * @implSpec This implementation calls {@code defaultAction}.
 397      *
 398      * @param node {@inheritDoc}
 399      * @param p {@inheritDoc}
 400      * @return  the result of {@code defaultAction}
 401      */
 402     @Override
 403     public R visitExpressionStatement(ExpressionStatementTree node, P p) {
 404         return defaultAction(node, p);
 405     }
 406 
 407     /**
 408      * {@inheritDoc}
 409      *
 410      * @implSpec This implementation calls {@code defaultAction}.
 411      *
 412      * @param node {@inheritDoc}
 413      * @param p {@inheritDoc}
 414      * @return  the result of {@code defaultAction}
 415      */
 416     @Override
 417     public R visitBreak(BreakTree node, P p) {
 418         return defaultAction(node, p);
 419     }
 420 
 421     /**
 422      * {@inheritDoc}
 423      *
 424      * @implSpec This implementation calls {@code defaultAction}.
 425      *
 426      * @param node {@inheritDoc}
 427      * @param p {@inheritDoc}
 428      * @return  the result of {@code defaultAction}
 429      */
 430     @Override
 431     public R visitContinue(ContinueTree node, P p) {
 432         return defaultAction(node, p);
 433     }
 434 
 435     /**
 436      * {@inheritDoc}
 437      *
 438      * @implSpec This implementation calls {@code defaultAction}.
 439      *
 440      * @param node {@inheritDoc}
 441      * @param p {@inheritDoc}
 442      * @return  the result of {@code defaultAction}
 443      */
 444     @Override
 445     public R visitReturn(ReturnTree node, P p) {
 446         return defaultAction(node, p);
 447     }
 448 
 449     /**
 450      * {@inheritDoc}
 451      *
 452      * @implSpec This implementation calls {@code defaultAction}.
 453      *
 454      * @param node {@inheritDoc}
 455      * @param p {@inheritDoc}
 456      * @return  the result of {@code defaultAction}
 457      */
 458     @Override
 459     public R visitThrow(ThrowTree node, P p) {
 460         return defaultAction(node, p);
 461     }
 462 
 463     /**
 464      * {@inheritDoc}
 465      *
 466      * @implSpec This implementation calls {@code defaultAction}.
 467      *
 468      * @param node {@inheritDoc}
 469      * @param p {@inheritDoc}
 470      * @return  the result of {@code defaultAction}
 471      */
 472     @Override
 473     public R visitAssert(AssertTree node, P p) {
 474         return defaultAction(node, p);
 475     }
 476 
 477     /**
 478      * {@inheritDoc}
 479      *
 480      * @implSpec This implementation calls {@code defaultAction}.
 481      *
 482      * @param node {@inheritDoc}
 483      * @param p {@inheritDoc}
 484      * @return  the result of {@code defaultAction}
 485      */
 486     @Override
 487     public R visitMethodInvocation(MethodInvocationTree node, P p) {
 488         return defaultAction(node, p);
 489     }
 490 
 491     /**
 492      * {@inheritDoc}
 493      *
 494      * @implSpec This implementation calls {@code defaultAction}.
 495      *
 496      * @param node {@inheritDoc}
 497      * @param p {@inheritDoc}
 498      * @return  the result of {@code defaultAction}
 499      */
 500     @Override
 501     public R visitNewClass(NewClassTree node, P p) {
 502         return defaultAction(node, p);
 503     }
 504 
 505     /**
 506      * {@inheritDoc}
 507      *
 508      * @implSpec This implementation calls {@code defaultAction}.
 509      *
 510      * @param node {@inheritDoc}
 511      * @param p {@inheritDoc}
 512      * @return  the result of {@code defaultAction}
 513      */
 514     @Override
 515     public R visitNewArray(NewArrayTree node, P p) {
 516         return defaultAction(node, p);
 517     }
 518 
 519     /**
 520      * {@inheritDoc}
 521      *
 522      * @implSpec This implementation calls {@code defaultAction}.
 523      *
 524      * @param node {@inheritDoc}
 525      * @param p {@inheritDoc}
 526      * @return  the result of {@code defaultAction}
 527      */
 528     @Override
 529     public R visitLambdaExpression(LambdaExpressionTree node, P p) {
 530         return defaultAction(node, p);
 531     }
 532 
 533     /**
 534      * {@inheritDoc}
 535      *
 536      * @implSpec This implementation calls {@code defaultAction}.
 537      *
 538      * @param node {@inheritDoc}
 539      * @param p {@inheritDoc}
 540      * @return  the result of {@code defaultAction}
 541      */
 542     @Override
 543     public R visitParenthesized(ParenthesizedTree node, P p) {
 544         return defaultAction(node, p);
 545     }
 546 
 547     /**
 548      * {@inheritDoc}
 549      *
 550      * @implSpec This implementation calls {@code defaultAction}.
 551      *
 552      * @param node {@inheritDoc}
 553      * @param p {@inheritDoc}
 554      * @return  the result of {@code defaultAction}
 555      */
 556     @Override
 557     public R visitAssignment(AssignmentTree node, P p) {
 558         return defaultAction(node, p);
 559     }
 560 
 561     /**
 562      * {@inheritDoc}
 563      *
 564      * @implSpec This implementation calls {@code defaultAction}.
 565      *
 566      * @param node {@inheritDoc}
 567      * @param p {@inheritDoc}
 568      * @return  the result of {@code defaultAction}
 569      */
 570     @Override
 571     public R visitCompoundAssignment(CompoundAssignmentTree node, P p) {
 572         return defaultAction(node, p);
 573     }
 574 
 575     /**
 576      * {@inheritDoc}
 577      *
 578      * @implSpec This implementation calls {@code defaultAction}.
 579      *
 580      * @param node {@inheritDoc}
 581      * @param p {@inheritDoc}
 582      * @return  the result of {@code defaultAction}
 583      */
 584     @Override
 585     public R visitUnary(UnaryTree node, P p) {
 586         return defaultAction(node, p);
 587     }
 588 
 589     /**
 590      * {@inheritDoc}
 591      *
 592      * @implSpec This implementation calls {@code defaultAction}.
 593      *
 594      * @param node {@inheritDoc}
 595      * @param p {@inheritDoc}
 596      * @return  the result of {@code defaultAction}
 597      */
 598     @Override
 599     public R visitBinary(BinaryTree node, P p) {
 600         return defaultAction(node, p);
 601     }
 602 
 603     /**
 604      * {@inheritDoc}
 605      *
 606      * @implSpec This implementation calls {@code defaultAction}.
 607      *
 608      * @param node {@inheritDoc}
 609      * @param p {@inheritDoc}
 610      * @return  the result of {@code defaultAction}
 611      */
 612     @Override
 613     public R visitTypeCast(TypeCastTree node, P p) {
 614         return defaultAction(node, p);
 615     }
 616 
 617     /**
 618      * {@inheritDoc}
 619      *
 620      * @implSpec This implementation calls {@code defaultAction}.
 621      *
 622      * @param node {@inheritDoc}
 623      * @param p {@inheritDoc}
 624      * @return  the result of {@code defaultAction}
 625      */
 626     @Override
 627     public R visitInstanceOf(InstanceOfTree node, P p) {
 628         return defaultAction(node, p);
 629     }
 630 
 631     /**
 632      * {@inheritDoc}
 633      *
 634      * @implSpec This implementation calls {@code defaultAction}.
 635      *
 636      * @param node {@inheritDoc}
 637      * @param p {@inheritDoc}
 638      * @return  the result of {@code defaultAction}
 639      * @since 14
 640      */
 641     @Override
 642     public R visitBindingPattern(BindingPatternTree node, P p) {
 643         return defaultAction(node, p);
 644     }
 645 
 646     /**
 647      * {@inheritDoc}
 648      *
 649      * @implSpec This implementation calls {@code defaultAction}.
 650      *
 651      * @param node {@inheritDoc}
 652      * @param p {@inheritDoc}
 653      * @return  the result of {@code defaultAction}
 654      * @since 17
 655      */
 656     @Override
 657     @PreviewFeature(feature=PreviewFeature.Feature.SWITCH_PATTERN_MATCHING, reflective=true)
 658     public R visitDefaultCaseLabel(DefaultCaseLabelTree node, P p) {
 659         return defaultAction(node, p);
 660     }
 661 
 662     /**
 663      * {@inheritDoc}
 664      *
 665      * @implSpec This implementation calls {@code defaultAction}.
 666      *
 667      * @param node {@inheritDoc}
 668      * @param p {@inheritDoc}
 669      * @return  the result of {@code defaultAction}
 670      */
 671     @Override
 672     public R visitArrayAccess(ArrayAccessTree node, P p) {
 673         return defaultAction(node, p);
 674     }
 675 
 676     /**
 677      * {@inheritDoc}
 678      *
 679      * @implSpec This implementation calls {@code defaultAction}.
 680      *
 681      * @param node {@inheritDoc}
 682      * @param p {@inheritDoc}
 683      * @return  the result of {@code defaultAction}
 684      */
 685     @Override
 686     public R visitMemberSelect(MemberSelectTree node, P p) {
 687         return defaultAction(node, p);
 688     }
 689 
 690     /**
 691      * {@inheritDoc}
 692      *
 693      * @implSpec This implementation calls {@code defaultAction}.
 694      *
 695      * @param node {@inheritDoc}
 696      * @param p {@inheritDoc}
 697      * @return  the result of {@code defaultAction}
 698      * @since 17
 699      */
 700     @Override
 701     @PreviewFeature(feature=PreviewFeature.Feature.SWITCH_PATTERN_MATCHING, reflective=true)
 702     public R visitParenthesizedPattern(ParenthesizedPatternTree node, P p) {
 703         return defaultAction(node, p);
 704     }
 705 
 706     /**
 707      * {@inheritDoc}
 708      *
 709      * @implSpec This implementation calls {@code defaultAction}.
 710      *
 711      * @param node {@inheritDoc}
 712      * @param p {@inheritDoc}
 713      * @return  the result of {@code defaultAction}
 714      * @since 17
 715      */
 716     @Override
 717     @PreviewFeature(feature=PreviewFeature.Feature.SWITCH_PATTERN_MATCHING, reflective=true)
 718     public R visitGuardedPattern(GuardedPatternTree node, P p) {
 719         return defaultAction(node, p);
 720     }
 721 
 722     /**
 723      * {@inheritDoc}
 724      *
 725      * @implSpec This implementation calls {@code defaultAction}.
 726      *
 727      * @param node {@inheritDoc}
 728      * @param p {@inheritDoc}
 729      * @return  the result of {@code defaultAction}
 730      */
 731     @Override
 732     public R visitMemberReference(MemberReferenceTree node, P p) {
 733         return defaultAction(node, p);
 734     }
 735 
 736     /**
 737      * {@inheritDoc}
 738      *
 739      * @implSpec This implementation calls {@code defaultAction}.
 740      *
 741      * @param node {@inheritDoc}
 742      * @param p {@inheritDoc}
 743      * @return  the result of {@code defaultAction}
 744      */
 745     @Override
 746     public R visitIdentifier(IdentifierTree node, P p) {
 747         return defaultAction(node, p);
 748     }
 749 
 750     /**
 751      * {@inheritDoc}
 752      *
 753      * @implSpec This implementation calls {@code defaultAction}.
 754      *
 755      * @param node {@inheritDoc}
 756      * @param p {@inheritDoc}
 757      * @return  the result of {@code defaultAction}
 758      */
 759     @Override
 760     public R visitLiteral(LiteralTree node, P p) {
 761         return defaultAction(node, p);
 762     }
 763 
 764     /**
 765      * {@inheritDoc}
 766      *
 767      * @implSpec This implementation calls {@code defaultAction}.
 768      *
 769      * @param node {@inheritDoc}
 770      * @param p {@inheritDoc}
 771      * @return  the result of {@code defaultAction}
 772      */
 773     @Override
 774     public R visitPrimitiveType(PrimitiveTypeTree node, P p) {
 775         return defaultAction(node, p);
 776     }
 777 
 778     /**
 779      * {@inheritDoc}
 780      *
 781      * @implSpec This implementation calls {@code defaultAction}.
 782      *
 783      * @param node {@inheritDoc}
 784      * @param p {@inheritDoc}
 785      * @return  the result of {@code defaultAction}
 786      */
 787     @Override
 788     public R visitArrayType(ArrayTypeTree node, P p) {
 789         return defaultAction(node, p);
 790     }
 791 
 792     /**
 793      * {@inheritDoc}
 794      *
 795      * @implSpec This implementation calls {@code defaultAction}.
 796      *
 797      * @param node {@inheritDoc}
 798      * @param p {@inheritDoc}
 799      * @return  the result of {@code defaultAction}
 800      */
 801     @Override
 802     public R visitParameterizedType(ParameterizedTypeTree node, P p) {
 803         return defaultAction(node, p);
 804     }
 805 
 806     /**
 807      * {@inheritDoc}
 808      *
 809      * @implSpec This implementation calls {@code defaultAction}.
 810      *
 811      * @param node {@inheritDoc}
 812      * @param p {@inheritDoc}
 813      * @return  the result of {@code defaultAction}
 814      */
 815     @Override
 816     public R visitUnionType(UnionTypeTree node, P p) {
 817         return defaultAction(node, p);
 818     }
 819 
 820     /**
 821      * {@inheritDoc}
 822      *
 823      * @implSpec This implementation calls {@code defaultAction}.
 824      *
 825      * @param node {@inheritDoc}
 826      * @param p {@inheritDoc}
 827      * @return  the result of {@code defaultAction}
 828      */
 829     @Override
 830     public R visitIntersectionType(IntersectionTypeTree node, P p) {
 831         return defaultAction(node, p);
 832     }
 833 
 834     /**
 835      * {@inheritDoc}
 836      *
 837      * @implSpec This implementation calls {@code defaultAction}.
 838      *
 839      * @param node {@inheritDoc}
 840      * @param p {@inheritDoc}
 841      * @return  the result of {@code defaultAction}
 842      */
 843     @Override
 844     public R visitTypeParameter(TypeParameterTree node, P p) {
 845         return defaultAction(node, p);
 846     }
 847 
 848     /**
 849      * {@inheritDoc}
 850      *
 851      * @implSpec This implementation calls {@code defaultAction}.
 852      *
 853      * @param node {@inheritDoc}
 854      * @param p {@inheritDoc}
 855      * @return  the result of {@code defaultAction}
 856      */
 857     @Override
 858     public R visitWildcard(WildcardTree node, P p) {
 859         return defaultAction(node, p);
 860     }
 861 
 862     /**
 863      * {@inheritDoc}
 864      *
 865      * @implSpec This implementation calls {@code defaultAction}.
 866      *
 867      * @param node {@inheritDoc}
 868      * @param p {@inheritDoc}
 869      * @return  the result of {@code defaultAction}
 870      */
 871     @Override
 872     public R visitModifiers(ModifiersTree node, P p) {
 873         return defaultAction(node, p);
 874     }
 875 
 876     /**
 877      * {@inheritDoc}
 878      *
 879      * @implSpec This implementation calls {@code defaultAction}.
 880      *
 881      * @param node {@inheritDoc}
 882      * @param p {@inheritDoc}
 883      * @return  the result of {@code defaultAction}
 884      */
 885     @Override
 886     public R visitAnnotation(AnnotationTree node, P p) {
 887         return defaultAction(node, p);
 888     }
 889 
 890     /**
 891      * {@inheritDoc}
 892      *
 893      * @implSpec This implementation calls {@code defaultAction}.
 894      *
 895      * @param node {@inheritDoc}
 896      * @param p {@inheritDoc}
 897      * @return  the result of {@code defaultAction}
 898      */
 899     @Override
 900     public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
 901         return defaultAction(node, p);
 902     }
 903 
 904     /**
 905      * {@inheritDoc}
 906      *
 907      * @implSpec This implementation calls {@code defaultAction}.
 908      *
 909      * @param node {@inheritDoc}
 910      * @param p {@inheritDoc}
 911      * @return  the result of {@code defaultAction}
 912      */
 913     @Override
 914     public R visitModule(ModuleTree node, P p) {
 915         return defaultAction(node, p);
 916     }
 917 
 918     /**
 919      * {@inheritDoc}
 920      *
 921      * @implSpec This implementation calls {@code defaultAction}.
 922      *
 923      * @param node {@inheritDoc}
 924      * @param p {@inheritDoc}
 925      * @return  the result of {@code defaultAction}
 926      */
 927     @Override
 928     public R visitExports(ExportsTree node, P p) {
 929         return defaultAction(node, p);
 930     }
 931 
 932     /**
 933      * {@inheritDoc}
 934      *
 935      * @implSpec This implementation calls {@code defaultAction}.
 936      *
 937      * @param node {@inheritDoc}
 938      * @param p {@inheritDoc}
 939      * @return  the result of {@code defaultAction}
 940      */
 941     @Override
 942     public R visitOpens(OpensTree node, P p) {
 943         return defaultAction(node, p);
 944     }
 945 
 946     /**
 947      * {@inheritDoc}
 948      *
 949      * @implSpec This implementation calls {@code defaultAction}.
 950      *
 951      * @param node {@inheritDoc}
 952      * @param p {@inheritDoc}
 953      * @return  the result of {@code defaultAction}
 954      */
 955     @Override
 956     public R visitProvides(ProvidesTree node, P p) {
 957         return defaultAction(node, p);
 958     }
 959 
 960     /**
 961      * {@inheritDoc}
 962      *
 963      * @implSpec This implementation calls {@code defaultAction}.
 964      *
 965      * @param node {@inheritDoc}
 966      * @param p {@inheritDoc}
 967      * @return  the result of {@code defaultAction}
 968      */
 969     @Override
 970     public R visitRequires(RequiresTree node, P p) {
 971         return defaultAction(node, p);
 972     }
 973 
 974     /**
 975      * {@inheritDoc}
 976      *
 977      * @implSpec This implementation calls {@code defaultAction}.
 978      *
 979      * @param node {@inheritDoc}
 980      * @param p {@inheritDoc}
 981      * @return  the result of {@code defaultAction}
 982      */
 983     @Override
 984     public R visitUses(UsesTree node, P p) {
 985         return defaultAction(node, p);
 986     }
 987 
 988     /**
 989      * {@inheritDoc}
 990      *
 991      * @implSpec This implementation calls {@code defaultAction}.
 992      *
 993      * @param node {@inheritDoc}
 994      * @param p {@inheritDoc}
 995      * @return  the result of {@code defaultAction}
 996      */
 997     @Override
 998     public R visitErroneous(ErroneousTree node, P p) {
 999         return defaultAction(node, p);
1000     }
1001 
1002     /**
1003      * {@inheritDoc}
1004      *
1005      * @implSpec This implementation calls {@code defaultAction}.
1006      *
1007      * @param node {@inheritDoc}
1008      * @param p {@inheritDoc}
1009      * @return  the result of {@code defaultAction}
1010      */
1011     @Override
1012     public R visitOther(Tree node, P p) {
1013         return defaultAction(node, p);
1014     }
1015 
1016     /**
1017      * {@inheritDoc}
1018      *
1019      * @implSpec This implementation calls {@code defaultAction}.
1020      *
1021      * @param node {@inheritDoc}
1022      * @param p {@inheritDoc}
1023      * @return  the result of {@code defaultAction}
1024      */
1025     @Override
1026     public R visitYield(YieldTree node, P p) {
1027         return defaultAction(node, p);
1028     }
1029 }