langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
author jjg
Mon, 10 Jan 2011 15:08:31 -0800
changeset 8032 e1aa25ccdabb
parent 8031 d5fe2c1cecfc
child 9300 c2de4dd9853b
permissions -rw-r--r--
6396503: javac should not require assertions enabled Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
8031
d5fe2c1cecfc 6992999: fully remove JSR 308 from langtools
jjg
parents: 7681
diff changeset
     2
 * Copyright (c) 2001, 2011, 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.tools.javac.tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.javac.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.javac.tree.JCTree.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
/** A subclass of Tree.Visitor, this class defines
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 *  a general tree scanner pattern. Translation proceeds recursively in
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 *  left-to-right order down a tree. There is one visitor method in this class
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 *  for every possible kind of tree node.  To obtain a specific
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 *  scanner, it suffices to override those visitor methods which
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *  do some interesting work. The scanner class itself takes care of all
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *  navigational aspects.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    39
 *  <p><b>This is NOT part of any supported API.
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    40
 *  If you write code that depends on this, you do so at your own risk.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *  This code and its internal interfaces are subject to change or
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *  deletion without notice.</b>
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
public class TreeScanner extends Visitor {
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
    /** Visitor method: Scan a single node.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    public void scan(JCTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        if(tree!=null) tree.accept(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    /** Visitor method: scan a list of nodes.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    public void scan(List<? extends JCTree> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        if (trees != null)
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
            scan(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
/* ***************************************************************************
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
 * Visitor methods
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
 ****************************************************************************/
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    public void visitTopLevel(JCCompilationUnit tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        scan(tree.packageAnnotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        scan(tree.pid);
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        scan(tree.defs);
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    public void visitImport(JCImport tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        scan(tree.qualid);
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    public void visitClassDef(JCClassDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
        scan(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
        scan(tree.typarams);
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
        scan(tree.extending);
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
        scan(tree.implementing);
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
        scan(tree.defs);
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    public void visitMethodDef(JCMethodDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        scan(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        scan(tree.restype);
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
        scan(tree.typarams);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
        scan(tree.params);
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
        scan(tree.thrown);
1786
88f03aba5cf9 6512707: "incompatible types" after (unrelated) annotation processing
jjg
parents: 10
diff changeset
    89
        scan(tree.defaultValue);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    public void visitVarDef(JCVariableDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
        scan(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        scan(tree.vartype);
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        scan(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    public void visitSkip(JCSkip tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    public void visitBlock(JCBlock tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        scan(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    public void visitDoLoop(JCDoWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
    public void visitWhileLoop(JCWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
    public void visitForLoop(JCForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        scan(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        scan(tree.step);
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    public void visitForeachLoop(JCEnhancedForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        scan(tree.var);
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
    public void visitLabelled(JCLabeledStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    public void visitSwitch(JCSwitch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        scan(tree.selector);
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        scan(tree.cases);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    public void visitCase(JCCase tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        scan(tree.pat);
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        scan(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
    public void visitSynchronized(JCSynchronized tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        scan(tree.lock);
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
    public void visitTry(JCTry tree) {
6148
3a8158299c51 6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents: 5847
diff changeset
   149
        scan(tree.resources);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        scan(tree.catchers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        scan(tree.finalizer);
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    public void visitCatch(JCCatch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
        scan(tree.param);
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    public void visitConditional(JCConditional tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        scan(tree.truepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        scan(tree.falsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
    public void visitIf(JCIf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        scan(tree.thenpart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        scan(tree.elsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    public void visitExec(JCExpressionStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    public void visitBreak(JCBreak tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    public void visitContinue(JCContinue tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
    public void visitReturn(JCReturn tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
    public void visitThrow(JCThrow tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
    public void visitAssert(JCAssert tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        scan(tree.detail);
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    public void visitApply(JCMethodInvocation tree) {
4877
b642d21c9f74 6923080: TreeScanner.visitNewClass should scan tree.typeargs
jjg
parents: 3149
diff changeset
   196
        scan(tree.typeargs);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
        scan(tree.meth);
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    public void visitNewClass(JCNewClass tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        scan(tree.encl);
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        scan(tree.clazz);
4877
b642d21c9f74 6923080: TreeScanner.visitNewClass should scan tree.typeargs
jjg
parents: 3149
diff changeset
   204
        scan(tree.typeargs);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        scan(tree.def);
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    public void visitNewArray(JCNewArray tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        scan(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        scan(tree.dims);
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
        scan(tree.elems);
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    public void visitParens(JCParens tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    public void visitAssign(JCAssign tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        scan(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    public void visitAssignop(JCAssignOp tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        scan(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    public void visitUnary(JCUnary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        scan(tree.arg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    public void visitBinary(JCBinary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
        scan(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    public void visitTypeCast(JCTypeCast tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    public void visitTypeTest(JCInstanceOf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
    public void visitIndexed(JCArrayAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        scan(tree.indexed);
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
        scan(tree.index);
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
    public void visitSelect(JCFieldAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
        scan(tree.selected);
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
    public void visitIdent(JCIdent tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    public void visitLiteral(JCLiteral tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
    public void visitTypeIdent(JCPrimitiveTypeTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
    public void visitTypeArray(JCArrayTypeTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
        scan(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
    public void visitTypeApply(JCTypeApply tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
        scan(tree.arguments);
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
7074
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 6148
diff changeset
   275
    public void visitTypeDisjunction(JCTypeDisjunction tree) {
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 6148
diff changeset
   276
        scan(tree.alternatives);
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4877
diff changeset
   277
    }
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4877
diff changeset
   278
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    public void visitTypeParameter(JCTypeParameter tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        scan(tree.bounds);
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
    public void visitWildcard(JCWildcard tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        scan(tree.kind);
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        if (tree.inner != null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
            scan(tree.inner);
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
    public void visitTypeBoundKind(TypeBoundKind that) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    public void visitModifiers(JCModifiers tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
        scan(tree.annotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
    public void visitAnnotation(JCAnnotation tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        scan(tree.annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
    public void visitErroneous(JCErroneous tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
    public void visitLetExpr(LetExpr tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
        scan(tree.defs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
    public void visitTree(JCTree tree) {
8032
e1aa25ccdabb 6396503: javac should not require assertions enabled
jjg
parents: 8031
diff changeset
   312
        Assert.error();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
}