src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
author rkennke
Fri, 12 Oct 2018 16:25:24 +0200
changeset 52107 0c1e44da019c
parent 51563 de411d537aae
child 55306 ea43db53de91
permissions -rw-r--r--
8212053: A few more missing object equals barriers Reviewed-by: shade, zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
     2
 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.source.util;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.source.tree.*;
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
    29
import com.sun.source.tree.CaseTree.CaseKind;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * A TreeVisitor that visits all the child tree nodes.
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * To visit nodes of a particular type, just override the
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * corresponding visitXYZ method.
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * Inside your method, call super.visitXYZ to visit descendant
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * nodes.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * <p>The default implementation of the visitXYZ methods will determine
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * a result as follows:
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * <ul>
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    41
 * <li>If the node being visited has no children, the result will be {@code null}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * <li>If the node being visited has one child, the result will be the
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * result of calling {@code scan} on that child. The child may be a simple node
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * or itself a list of nodes.
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * <li> If the node being visited has more than one child, the result will
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * be determined by calling {@code scan} each child in turn, and then combining the
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * result of each scan after the first with the cumulative result
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * so far, as determined by the {@link #reduce} method. Each child may be either
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * a simple node of a list of nodes. The default behavior of the {@code reduce}
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * method is such that the result of the visitXYZ method will be the result of
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 * the last child scanned.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 * <p>Here is an example to count the number of identifier nodes in a tree:
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 * <pre>
13844
56339cf983a3 7177970: fix issues in langtools doc comments
jjg
parents: 11142
diff changeset
    56
 *   class CountIdentifiers extends TreeScanner&lt;Integer,Void&gt; {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 *      {@literal @}Override
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 *      public Integer visitIdentifier(IdentifierTree node, Void p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 *          return 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
 *      }
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
 *      {@literal @}Override
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
 *      public Integer reduce(Integer r1, Integer r2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
 *          return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
 *      }
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
 *   }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
 * </pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
 *
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    68
 * @param <R> the return type of this visitor's methods.  Use {@link
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    69
 *            Void} for visitors that do not need to return results.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    70
 * @param <P> the type of the additional parameter to this visitor's
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    71
 *            methods.  Use {@code Void} for visitors that do not need an
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    72
 *            additional parameter.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    73
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
 * @author Peter von der Ah&eacute;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
 * @author Jonathan Gibbons
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
 * @since 1.6
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
public class TreeScanner<R,P> implements TreeVisitor<R,P> {
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    80
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    81
     * Scans a single node.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    82
     * @param tree the node to be scanned
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    83
     * @param p a parameter value passed to the visit method
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    84
     * @return the result value from the visit method
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     */
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    86
    public R scan(Tree tree, P p) {
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    87
        return (tree == null) ? null : tree.accept(this, p);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    private R scanAndReduce(Tree node, P p, R r) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
        return reduce(scan(node, p), r);
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    94
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    95
     * Scans a sequence of nodes.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    96
     * @param nodes the nodes to be scanned
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    97
     * @param p a parameter value to be passed to the visit method for each node
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    98
     * @return the combined return value from the visit methods.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
    99
     *      The values are combined using the {@link #reduce reduce} method.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    public R scan(Iterable<? extends Tree> nodes, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
        R r = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        if (nodes != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
            boolean first = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
            for (Tree node : nodes) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
                r = (first ? scan(node, p) : scanAndReduce(node, p, r));
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
                first = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    private R scanAndReduce(Iterable<? extends Tree> nodes, P p, R r) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        return reduce(scan(nodes, p), r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
     * Reduces two results into a combined result.
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
     * The default implementation is to return the first parameter.
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * The general contract of the method is that it may take any action whatsoever.
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   121
     * @param r1 the first of the values to be combined
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   122
     * @param r2 the second of the values to be combined
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   123
     * @return the result of combining the two parameters
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
    public R reduce(R r1, R r2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        return r1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
/* ***************************************************************************
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
 * Visitor methods
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
 ****************************************************************************/
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   134
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   135
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   136
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   137
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   138
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   139
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   140
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   141
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    public R visitCompilationUnit(CompilationUnitTree node, P p) {
24069
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   143
        R r = scan(node.getPackage(), p);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        r = scanAndReduce(node.getImports(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        r = scanAndReduce(node.getTypeDecls(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   149
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   150
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   151
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   152
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   153
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   154
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   155
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   156
    @Override
24069
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   157
    public R visitPackage(PackageTree node, P p) {
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   158
        R r = scan(node.getAnnotations(), p);
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   159
        r = scanAndReduce(node.getPackageName(), p, r);
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   160
        return r;
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   161
    }
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 20612
diff changeset
   162
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   163
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   164
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   165
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   166
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   167
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   168
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   169
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   170
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    public R visitImport(ImportTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
        return scan(node.getQualifiedIdentifier(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   175
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   176
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   177
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   178
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   179
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   180
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   181
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   182
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    public R visitClass(ClassTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        R r = scan(node.getModifiers(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        r = scanAndReduce(node.getTypeParameters(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        r = scanAndReduce(node.getExtendsClause(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        r = scanAndReduce(node.getImplementsClause(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        r = scanAndReduce(node.getMembers(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   192
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   193
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   194
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   195
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   196
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   197
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   198
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   199
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    public R visitMethod(MethodTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        R r = scan(node.getModifiers(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        r = scanAndReduce(node.getReturnType(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        r = scanAndReduce(node.getTypeParameters(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        r = scanAndReduce(node.getParameters(), p, r);
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   205
        r = scanAndReduce(node.getReceiverParameter(), p, r);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        r = scanAndReduce(node.getThrows(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
        r = scanAndReduce(node.getBody(), p, r);
6597
9367c22c445f 6983239: TreeScanner does not scan default value for method
jjg
parents: 6148
diff changeset
   208
        r = scanAndReduce(node.getDefaultValue(), p, r);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   212
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   213
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   214
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   215
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   216
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   217
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   218
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   219
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    public R visitVariable(VariableTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        R r = scan(node.getModifiers(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
        r = scanAndReduce(node.getType(), p, r);
17580
6696a7abec02 8014323: Add VariableTree.getNameExpression
jjg
parents: 16303
diff changeset
   223
        r = scanAndReduce(node.getNameExpression(), p, r);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        r = scanAndReduce(node.getInitializer(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   228
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   229
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   230
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   231
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   232
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   233
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   234
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   235
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
    public R visitEmptyStatement(EmptyStatementTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   240
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   241
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   242
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   243
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   244
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   245
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   246
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   247
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
    public R visitBlock(BlockTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        return scan(node.getStatements(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   252
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   253
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   254
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   255
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   256
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   257
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   258
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   259
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    public R visitDoWhileLoop(DoWhileLoopTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
        R r = scan(node.getStatement(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
        r = scanAndReduce(node.getCondition(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   266
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   267
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   268
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   269
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   270
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   271
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   272
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   273
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    public R visitWhileLoop(WhileLoopTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        R r = scan(node.getCondition(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        r = scanAndReduce(node.getStatement(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   280
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   281
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   282
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   283
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   284
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   285
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   286
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   287
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    public R visitForLoop(ForLoopTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
        R r = scan(node.getInitializer(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        r = scanAndReduce(node.getCondition(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        r = scanAndReduce(node.getUpdate(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        r = scanAndReduce(node.getStatement(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   296
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   297
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   298
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   299
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   300
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   301
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   302
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   303
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
    public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        R r = scan(node.getVariable(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
        r = scanAndReduce(node.getExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
        r = scanAndReduce(node.getStatement(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   311
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   312
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   313
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   314
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   315
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   316
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   317
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   318
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
    public R visitLabeledStatement(LabeledStatementTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
        return scan(node.getStatement(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   323
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   324
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   325
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   326
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   327
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   328
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   329
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   330
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
    public R visitSwitch(SwitchTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
        R r = scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
        r = scanAndReduce(node.getCases(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   337
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   338
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   339
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   340
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   341
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   342
     * @return the result of scanning
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   343
     *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   344
     * @deprecated
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   345
     * This method is modeling switch expressions,
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   346
     * which are part of a preview feature and may be removed
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   347
     * if the preview feature is removed.
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   348
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   349
    @Override
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   350
    @Deprecated(forRemoval=true, since="12")
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   351
    @SuppressWarnings("removal")
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   352
    public R visitSwitchExpression(SwitchExpressionTree node, P p) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
        R r = scan(node.getExpression(), p);
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   354
        r = scanAndReduce(node.getCases(), p, r);
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   355
        return r;
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   356
    }
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   357
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   358
    /**
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   359
     * {@inheritDoc} This implementation scans the children in left to right order.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   360
     *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   361
     * @param node  {@inheritDoc}
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   362
     * @param p  {@inheritDoc}
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   363
     * @return the result of scanning
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   364
     */
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   365
    @Override
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   366
    @SuppressWarnings("removal")
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   367
    public R visitCase(CaseTree node, P p) {
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   368
        R r = scan(node.getExpressions(), p);
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   369
        if (node.getCaseKind() == CaseKind.RULE)
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   370
            r = scanAndReduce(node.getBody(), p, r);
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   371
        else
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   372
            r = scanAndReduce(node.getStatements(), p, r);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   376
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   377
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   378
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   379
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   380
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   381
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   382
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   383
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
    public R visitSynchronized(SynchronizedTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
        R r = scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
        r = scanAndReduce(node.getBlock(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   390
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   391
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   392
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   393
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   394
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   395
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   396
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   397
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
    public R visitTry(TryTree node, P p) {
6148
3a8158299c51 6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents: 5520
diff changeset
   399
        R r = scan(node.getResources(), p);
3a8158299c51 6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents: 5520
diff changeset
   400
        r = scanAndReduce(node.getBlock(), p, r);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
        r = scanAndReduce(node.getCatches(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
        r = scanAndReduce(node.getFinallyBlock(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   406
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   407
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   408
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   409
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   410
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   411
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   412
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   413
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
    public R visitCatch(CatchTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
        R r = scan(node.getParameter(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
        r = scanAndReduce(node.getBlock(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   420
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   421
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   422
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   423
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   424
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   425
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   426
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   427
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
    public R visitConditionalExpression(ConditionalExpressionTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
        R r = scan(node.getCondition(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
        r = scanAndReduce(node.getTrueExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
        r = scanAndReduce(node.getFalseExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   435
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   436
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   437
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   438
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   439
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   440
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   441
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   442
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
    public R visitIf(IfTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        R r = scan(node.getCondition(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
        r = scanAndReduce(node.getThenStatement(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
        r = scanAndReduce(node.getElseStatement(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   450
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   451
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   452
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   453
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   454
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   455
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   456
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   457
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
    public R visitExpressionStatement(ExpressionStatementTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   462
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   463
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   464
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   465
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   466
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   467
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   468
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   469
    @Override
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   470
    @SuppressWarnings("removal")
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
    public R visitBreak(BreakTree node, P p) {
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   472
        return scan(node.getValue(), p);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   475
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   476
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   477
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   478
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   479
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   480
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   481
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   482
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
    public R visitContinue(ContinueTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   487
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   488
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   489
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   490
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   491
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   492
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   493
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   494
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
    public R visitReturn(ReturnTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   499
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   500
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   501
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   502
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   503
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   504
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   505
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   506
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
    public R visitThrow(ThrowTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   511
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   512
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   513
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   514
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   515
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   516
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   517
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   518
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
    public R visitAssert(AssertTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
        R r = scan(node.getCondition(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
        r = scanAndReduce(node.getDetail(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   525
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   526
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   527
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   528
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   529
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   530
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   531
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   532
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
    public R visitMethodInvocation(MethodInvocationTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
        R r = scan(node.getTypeArguments(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
        r = scanAndReduce(node.getMethodSelect(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
        r = scanAndReduce(node.getArguments(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   540
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   541
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   542
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   543
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   544
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   545
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   546
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   547
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
    public R visitNewClass(NewClassTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
        R r = scan(node.getEnclosingExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
        r = scanAndReduce(node.getIdentifier(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
        r = scanAndReduce(node.getTypeArguments(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
        r = scanAndReduce(node.getArguments(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
        r = scanAndReduce(node.getClassBody(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   557
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   558
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   559
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   560
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   561
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   562
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   563
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   564
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   565
    public R visitNewArray(NewArrayTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
        R r = scan(node.getType(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
        r = scanAndReduce(node.getDimensions(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
        r = scanAndReduce(node.getInitializers(), p, r);
19491
887e13b16ccf 6983297: methods missing from NewArrayTree
vromero
parents: 17580
diff changeset
   569
        r = scanAndReduce(node.getAnnotations(), p, r);
887e13b16ccf 6983297: methods missing from NewArrayTree
vromero
parents: 17580
diff changeset
   570
        for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) {
887e13b16ccf 6983297: methods missing from NewArrayTree
vromero
parents: 17580
diff changeset
   571
            r = scanAndReduce(dimAnno, p, r);
887e13b16ccf 6983297: methods missing from NewArrayTree
vromero
parents: 17580
diff changeset
   572
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   573
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   575
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   576
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   577
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   578
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   579
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   580
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   581
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   582
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   583
    @Override
11141
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   584
    public R visitLambdaExpression(LambdaExpressionTree node, P p) {
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   585
        R r = scan(node.getParameters(), p);
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   586
        r = scanAndReduce(node.getBody(), p, r);
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   587
        return r;
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   588
    }
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   589
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   590
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   591
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   592
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   593
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   594
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   595
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   596
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   597
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
    public R visitParenthesized(ParenthesizedTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   602
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   603
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   604
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   605
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   606
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   607
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   608
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   609
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
    public R visitAssignment(AssignmentTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
        R r = scan(node.getVariable(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   612
        r = scanAndReduce(node.getExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   613
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   614
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   615
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   616
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   617
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   618
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   619
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   620
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   621
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   622
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   623
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   624
    public R visitCompoundAssignment(CompoundAssignmentTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   625
        R r = scan(node.getVariable(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   626
        r = scanAndReduce(node.getExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   627
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   628
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   629
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   630
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   631
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   632
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   633
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   634
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   635
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   636
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   637
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   638
    public R visitUnary(UnaryTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   639
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   640
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   641
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   642
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   643
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   644
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   645
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   646
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   647
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   648
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   649
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   650
    public R visitBinary(BinaryTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   651
        R r = scan(node.getLeftOperand(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   652
        r = scanAndReduce(node.getRightOperand(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   653
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   654
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   655
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   656
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   657
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   658
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   659
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   660
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   661
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   662
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   663
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   664
    public R visitTypeCast(TypeCastTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   665
        R r = scan(node.getType(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   666
        r = scanAndReduce(node.getExpression(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   667
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   668
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   669
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   670
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   671
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   672
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   673
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   674
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   675
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   676
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   677
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   678
    public R visitInstanceOf(InstanceOfTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   679
        R r = scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   680
        r = scanAndReduce(node.getType(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   681
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   682
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   683
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   684
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   685
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   686
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   687
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   688
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   689
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   690
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   691
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   692
    public R visitArrayAccess(ArrayAccessTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   693
        R r = scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   694
        r = scanAndReduce(node.getIndex(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   695
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   696
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   697
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   698
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   699
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   700
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   701
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   702
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   703
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   704
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   705
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   706
    public R visitMemberSelect(MemberSelectTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   707
        return scan(node.getExpression(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   708
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   709
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   710
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   711
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   712
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   713
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   714
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   715
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   716
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   717
    @Override
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   718
    public R visitMemberReference(MemberReferenceTree node, P p) {
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   719
        R r = scan(node.getQualifierExpression(), p);
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   720
        r = scanAndReduce(node.getTypeArguments(), p, r);
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   721
        return r;
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   722
    }
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   723
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   724
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   725
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   726
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   727
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   728
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   729
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   730
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   731
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   732
    public R visitIdentifier(IdentifierTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   733
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   734
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   735
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   736
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   737
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   738
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   739
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   740
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   741
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   742
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   743
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   744
    public R visitLiteral(LiteralTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   745
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   746
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   747
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   748
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   749
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   750
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   751
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   752
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   753
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   754
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   755
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   756
    public R visitPrimitiveType(PrimitiveTypeTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   757
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   758
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   759
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   760
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   761
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   762
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   763
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   764
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   765
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   766
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   767
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   768
    public R visitArrayType(ArrayTypeTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   769
        return scan(node.getType(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   770
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   771
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   772
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   773
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   774
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   775
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   776
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   777
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   778
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   779
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   780
    public R visitParameterizedType(ParameterizedTypeTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   781
        R r = scan(node.getType(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   782
        r = scanAndReduce(node.getTypeArguments(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   783
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   784
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   785
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   786
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   787
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   788
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   789
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   790
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   791
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   792
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   793
    @Override
9300
c2de4dd9853b 7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents: 8031
diff changeset
   794
    public R visitUnionType(UnionTypeTree node, P p) {
7074
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 7072
diff changeset
   795
        return scan(node.getTypeAlternatives(), p);
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   796
    }
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   797
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   798
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   799
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   800
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   801
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   802
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   803
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   804
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   805
    @Override
14725
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 13844
diff changeset
   806
    public R visitIntersectionType(IntersectionTypeTree node, P p) {
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 13844
diff changeset
   807
        return scan(node.getBounds(), p);
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 13844
diff changeset
   808
    }
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 13844
diff changeset
   809
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   810
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   811
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   812
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   813
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   814
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   815
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   816
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   817
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   818
    public R visitTypeParameter(TypeParameterTree node, P p) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   819
        R r = scan(node.getAnnotations(), p);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   820
        r = scanAndReduce(node.getBounds(), p, r);
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 10
diff changeset
   821
        return r;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   822
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   823
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   824
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   825
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   826
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   827
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   828
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   829
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   830
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   831
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   832
    public R visitWildcard(WildcardTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   833
        return scan(node.getBound(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   834
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   835
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   836
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   837
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   838
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   839
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   840
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   841
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   842
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   843
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   844
    public R visitModifiers(ModifiersTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   845
        return scan(node.getAnnotations(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   846
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   847
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   848
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   849
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   850
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   851
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   852
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   853
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   854
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   855
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   856
    public R visitAnnotation(AnnotationTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   857
        R r = scan(node.getAnnotationType(), p);
06bc494ca11e Initial load
duke
parents:
diff changeset
   858
        r = scanAndReduce(node.getArguments(), p, r);
06bc494ca11e Initial load
duke
parents:
diff changeset
   859
        return r;
06bc494ca11e Initial load
duke
parents:
diff changeset
   860
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   861
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   862
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   863
     * {@inheritDoc} This implementation scans the children in left to right order.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   864
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   865
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   866
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   867
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   868
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   869
    @Override
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   870
    public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   871
        R r = scan(node.getAnnotations(), p);
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   872
        r = scanAndReduce(node.getUnderlyingType(), p, r);
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   873
        return r;
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   874
    }
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   875
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   876
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   877
    public R visitModule(ModuleTree node, P p) {
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   878
        R r = scan(node.getAnnotations(), p);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   879
        r = scanAndReduce(node.getName(), p, r);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   880
        r = scanAndReduce(node.getDirectives(), p, r);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   881
        return r;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   882
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   883
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   884
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   885
    public R visitExports(ExportsTree node, P p) {
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   886
        R r = scan(node.getPackageName(), p);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   887
        r = scanAndReduce(node.getModuleNames(), p, r);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   888
        return r;
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   889
    }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   890
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   891
    @Override
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   892
    public R visitOpens(OpensTree node, P p) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   893
        R r = scan(node.getPackageName(), p);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   894
        r = scanAndReduce(node.getModuleNames(), p, r);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   895
        return r;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   896
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   897
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   898
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   899
    public R visitProvides(ProvidesTree node, P p) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   900
        R r = scan(node.getServiceName(), p);
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   901
        r = scanAndReduce(node.getImplementationNames(), p, r);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   902
        return r;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   903
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   904
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   905
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   906
    public R visitRequires(RequiresTree node, P p) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   907
        return scan(node.getModuleName(), p);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   908
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   909
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   910
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   911
    public R visitUses(UsesTree node, P p) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   912
        return scan(node.getServiceName(), p);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   913
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 34916
diff changeset
   914
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   915
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   916
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   917
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   918
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   919
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   920
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   921
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   922
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   923
    public R visitOther(Tree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   924
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   925
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   926
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   927
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   928
     * {@inheritDoc} This implementation returns {@code null}.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   929
     *
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   930
     * @param node  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   931
     * @param p  {@inheritDoc}
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   932
     * @return the result of scanning
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   933
     */
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 24069
diff changeset
   934
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   935
    public R visitErroneous(ErroneousTree node, P p) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   936
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   937
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   938
}