langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
author jjg
Tue, 26 Oct 2010 14:29:48 -0700
changeset 7074 0183c3f9614e
parent 6148 3a8158299c51
child 7681 1f0819a3341f
permissions -rw-r--r--
6949587: rename "DisjointType" to "DisjunctType" Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     2
 * Copyright (c) 2001, 2006, 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);
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
    88
        scan(tree.receiverAnnotations);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
        scan(tree.thrown);
1786
88f03aba5cf9 6512707: "incompatible types" after (unrelated) annotation processing
jjg
parents: 10
diff changeset
    90
        scan(tree.defaultValue);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    public void visitVarDef(JCVariableDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        scan(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        scan(tree.vartype);
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        scan(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public void visitSkip(JCSkip tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    public void visitBlock(JCBlock tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        scan(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    public void visitDoLoop(JCDoWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    public void visitWhileLoop(JCWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    public void visitForLoop(JCForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        scan(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        scan(tree.step);
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    public void visitForeachLoop(JCEnhancedForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        scan(tree.var);
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
    public void visitLabelled(JCLabeledStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    public void visitSwitch(JCSwitch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        scan(tree.selector);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        scan(tree.cases);
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
    public void visitCase(JCCase tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        scan(tree.pat);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
        scan(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    public void visitSynchronized(JCSynchronized tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        scan(tree.lock);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    public void visitTry(JCTry tree) {
6148
3a8158299c51 6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents: 5847
diff changeset
   150
        scan(tree.resources);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        scan(tree.catchers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        scan(tree.finalizer);
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    public void visitCatch(JCCatch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        scan(tree.param);
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        scan(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    public void visitConditional(JCConditional tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        scan(tree.truepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
        scan(tree.falsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    public void visitIf(JCIf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        scan(tree.thenpart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        scan(tree.elsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    public void visitExec(JCExpressionStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    public void visitBreak(JCBreak tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
    public void visitContinue(JCContinue tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    public void visitReturn(JCReturn tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
    public void visitThrow(JCThrow tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
    public void visitAssert(JCAssert tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        scan(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        scan(tree.detail);
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    public void visitApply(JCMethodInvocation tree) {
4877
b642d21c9f74 6923080: TreeScanner.visitNewClass should scan tree.typeargs
jjg
parents: 3149
diff changeset
   197
        scan(tree.typeargs);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        scan(tree.meth);
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
    public void visitNewClass(JCNewClass tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        scan(tree.encl);
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        scan(tree.clazz);
4877
b642d21c9f74 6923080: TreeScanner.visitNewClass should scan tree.typeargs
jjg
parents: 3149
diff changeset
   205
        scan(tree.typeargs);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
        scan(tree.def);
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    public void visitNewArray(JCNewArray tree) {
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   211
        scan(tree.annotations);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
        scan(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
        scan(tree.dims);
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   214
        for (List<JCTypeAnnotation> annos : tree.dimAnnotations)
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   215
            scan(annos);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
        scan(tree.elems);
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 visitParens(JCParens tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
    public void visitAssign(JCAssign tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        scan(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    public void visitAssignop(JCAssignOp tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        scan(tree.rhs);
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 visitUnary(JCUnary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        scan(tree.arg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    public void visitBinary(JCBinary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
        scan(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
        scan(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
    public void visitTypeCast(JCTypeCast tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
    public void visitTypeTest(JCInstanceOf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    public void visitIndexed(JCArrayAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
        scan(tree.indexed);
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
        scan(tree.index);
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 visitSelect(JCFieldAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
        scan(tree.selected);
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
    public void visitIdent(JCIdent tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    public void visitLiteral(JCLiteral tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
    public void visitTypeIdent(JCPrimitiveTypeTree tree) {
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 visitTypeArray(JCArrayTypeTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
        scan(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    public void visitTypeApply(JCTypeApply tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        scan(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        scan(tree.arguments);
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
7074
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 6148
diff changeset
   279
    public void visitTypeDisjunction(JCTypeDisjunction tree) {
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 6148
diff changeset
   280
        scan(tree.alternatives);
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4877
diff changeset
   281
    }
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4877
diff changeset
   282
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
    public void visitTypeParameter(JCTypeParameter tree) {
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   284
        scan(tree.annotations);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        scan(tree.bounds);
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
    public void visitWildcard(JCWildcard tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        scan(tree.kind);
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        if (tree.inner != null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
            scan(tree.inner);
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
    public void visitTypeBoundKind(TypeBoundKind that) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
    public void visitModifiers(JCModifiers tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        scan(tree.annotations);
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 visitAnnotation(JCAnnotation tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
        scan(tree.annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        scan(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   308
    public void visitAnnotatedType(JCAnnotatedType tree) {
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   309
        scan(tree.annotations);
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   310
        scan(tree.underlyingType);
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   311
    }
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 1786
diff changeset
   312
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
    public void visitErroneous(JCErroneous tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
    public void visitLetExpr(LetExpr tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        scan(tree.defs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
        scan(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    public void visitTree(JCTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
        assert false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
}