langtools/src/share/classes/com/sun/source/tree/Tree.java
author mcimadamore
Thu, 24 Nov 2011 13:36:20 +0000
changeset 11141 7d112a1ecd0f
parent 9300 c2de4dd9853b
child 11142 45d0ec1e7463
permissions -rw-r--r--
7115046: Add AST node for lambda expressions Summary: Add tree nodes for representing lambda expressions and update relevant visitors interfaces Reviewed-by: jjg
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) 2005, 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.source.tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 * Common interface for all nodes in an abstract syntax tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * <p><b>WARNING:</b> This interface and its sub-interfaces are
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * subject to change as the Java&trade; programming language evolves.
5848
c5a4ce47e780 6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    33
 * These interfaces are implemented by the JDK Java compiler (javac)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * and should not be implemented either directly or indirectly by
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * other applications.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * @author Peter von der Ah&eacute;
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @author Jonathan Gibbons
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @since 1.6
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
public interface Tree {
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
     * Enumerates all kinds of trees.
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    public enum Kind {
3149
0cd06d598d6f 6843077: JSR 308: Annotations on types
jjg
parents: 10
diff changeset
    48
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
         * Used for instances of {@link AnnotationTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
        ANNOTATION(AnnotationTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
         * Used for instances of {@link ArrayAccessTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
        ARRAY_ACCESS(ArrayAccessTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
         * Used for instances of {@link ArrayTypeTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
        ARRAY_TYPE(ArrayTypeTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
         * Used for instances of {@link AssertTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        ASSERT(AssertTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
         * Used for instances of {@link AssignmentTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        ASSIGNMENT(AssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
         * Used for instances of {@link BlockTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
        BLOCK(BlockTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
         * Used for instances of {@link BreakTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
        BREAK(BreakTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
         * Used for instances of {@link CaseTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
        CASE(CaseTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
         * Used for instances of {@link CatchTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
        CATCH(CatchTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
        /**
6580
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
    95
         * Used for instances of {@link ClassTree} representing classes.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        CLASS(ClassTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
         * Used for instances of {@link CompilationUnitTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
        COMPILATION_UNIT(CompilationUnitTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
         * Used for instances of {@link ConditionalExpressionTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
         * Used for instances of {@link ContinueTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
        CONTINUE(ContinueTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
         * Used for instances of {@link DoWhileLoopTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        DO_WHILE_LOOP(DoWhileLoopTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
         * Used for instances of {@link EnhancedForLoopTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        ENHANCED_FOR_LOOP(EnhancedForLoopTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
         * Used for instances of {@link ExpressionStatementTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        EXPRESSION_STATEMENT(ExpressionStatementTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
         * Used for instances of {@link MemberSelectTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        MEMBER_SELECT(MemberSelectTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
         * Used for instances of {@link ForLoopTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        FOR_LOOP(ForLoopTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
         * Used for instances of {@link IdentifierTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        IDENTIFIER(IdentifierTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
         * Used for instances of {@link IfTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        IF(IfTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
         * Used for instances of {@link ImportTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        IMPORT(ImportTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
         * Used for instances of {@link InstanceOfTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        INSTANCE_OF(InstanceOfTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
         * Used for instances of {@link LabeledStatementTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        LABELED_STATEMENT(LabeledStatementTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
         * Used for instances of {@link MethodTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
        METHOD(MethodTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
         * Used for instances of {@link MethodInvocationTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
        METHOD_INVOCATION(MethodInvocationTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
         * Used for instances of {@link ModifiersTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        MODIFIERS(ModifiersTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
         * Used for instances of {@link NewArrayTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        NEW_ARRAY(NewArrayTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
         * Used for instances of {@link NewClassTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        NEW_CLASS(NewClassTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
        /**
11141
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   190
         * Used for instances of {@link LambdaExpressionTree}.
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   191
         */
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   192
        LAMBDA_EXPRESSION(LambdaExpressionTree.class),
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   193
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   194
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
         * Used for instances of {@link ParenthesizedTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
        PARENTHESIZED(ParenthesizedTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
         * Used for instances of {@link PrimitiveTypeTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        PRIMITIVE_TYPE(PrimitiveTypeTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
         * Used for instances of {@link ReturnTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
        RETURN(ReturnTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
         * Used for instances of {@link EmptyStatementTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
        EMPTY_STATEMENT(EmptyStatementTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
         * Used for instances of {@link SwitchTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
        SWITCH(SwitchTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
         * Used for instances of {@link SynchronizedTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
        SYNCHRONIZED(SynchronizedTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
         * Used for instances of {@link ThrowTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        THROW(ThrowTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
         * Used for instances of {@link TryTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
        TRY(TryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
         * Used for instances of {@link ParameterizedTypeTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        PARAMETERIZED_TYPE(ParameterizedTypeTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
        /**
9300
c2de4dd9853b 7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents: 8031
diff changeset
   240
         * Used for instances of {@link UnionTypeTree}.
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   241
         */
9300
c2de4dd9853b 7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents: 8031
diff changeset
   242
        UNION_TYPE(UnionTypeTree.class),
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   243
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   244
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
         * Used for instances of {@link TypeCastTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
        TYPE_CAST(TypeCastTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
         * Used for instances of {@link TypeParameterTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
        TYPE_PARAMETER(TypeParameterTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
         * Used for instances of {@link VariableTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
        VARIABLE(VariableTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
         * Used for instances of {@link WhileLoopTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
        WHILE_LOOP(WhileLoopTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
         * Used for instances of {@link UnaryTree} representing postfix
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
         * increment operator {@code ++}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
        POSTFIX_INCREMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
         * Used for instances of {@link UnaryTree} representing postfix
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
         * decrement operator {@code --}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
        POSTFIX_DECREMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
         * Used for instances of {@link UnaryTree} representing prefix
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
         * increment operator {@code ++}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        PREFIX_INCREMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
         * Used for instances of {@link UnaryTree} representing prefix
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
         * decrement operator {@code --}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        PREFIX_DECREMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
         * Used for instances of {@link UnaryTree} representing unary plus
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
         * operator {@code +}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        UNARY_PLUS(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
         * Used for instances of {@link UnaryTree} representing unary minus
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
         * operator {@code -}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        UNARY_MINUS(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
         * Used for instances of {@link UnaryTree} representing bitwise
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
         * complement operator {@code ~}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
        BITWISE_COMPLEMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
         * Used for instances of {@link UnaryTree} representing logical
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
         * complement operator {@code !}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
        LOGICAL_COMPLEMENT(UnaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
         * multiplication {@code *}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        MULTIPLY(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
         * division {@code /}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
        DIVIDE(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
         * remainder {@code %}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
        REMAINDER(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
         * addition or string concatenation {@code +}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
        PLUS(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
         * subtraction {@code -}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
        MINUS(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
         * left shift {@code <<}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
        LEFT_SHIFT(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
         * right shift {@code >>}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
        RIGHT_SHIFT(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
         * unsigned right shift {@code >>>}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
        UNSIGNED_RIGHT_SHIFT(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
         * less-than {@code <}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
        LESS_THAN(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
         * greater-than {@code >}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
        GREATER_THAN(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
         * less-than-equal {@code <=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
        LESS_THAN_EQUAL(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
         * greater-than-equal {@code >=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
        GREATER_THAN_EQUAL(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
         * equal-to {@code ==}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
        EQUAL_TO(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
         * not-equal-to {@code !=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
        NOT_EQUAL_TO(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
         * bitwise and logical "and" {@code &}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
        AND(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
         * bitwise and logical "xor" {@code ^}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
        XOR(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
         * bitwise and logical "or" {@code |}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
        OR(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
         * conditional-and {@code &&}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
        CONDITIONAL_AND(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
         * Used for instances of {@link BinaryTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
         * conditional-or {@code ||}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
        CONDITIONAL_OR(BinaryTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
         * multiplication assignment {@code *=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
        MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
         * division assignment {@code /=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
        DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
         * remainder assignment {@code %=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
        REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
         * addition or string concatenation assignment {@code +=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
        PLUS_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
         * subtraction assignment {@code -=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
        MINUS_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
         * left shift assignment {@code <<=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
        LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
         * right shift assignment {@code >>=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
        RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
         * unsigned right shift assignment {@code >>>=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
        UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
         * bitwise and logical "and" assignment {@code &=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
        AND_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
         * bitwise and logical "xor" assignment {@code ^=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
        XOR_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
         * Used for instances of {@link CompoundAssignmentTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
         * bitwise and logical "or" assignment {@code |=}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
        OR_ASSIGNMENT(CompoundAssignmentTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
         * an integral literal expression of type {@code int}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
        INT_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
         * an integral literal expression of type {@code long}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
        LONG_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
         * a floating-point literal expression of type {@code float}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
        FLOAT_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
         * a floating-point literal expression of type {@code double}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
        DOUBLE_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
         * a boolean literal expression of type {@code boolean}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
        BOOLEAN_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
         * a character literal expression of type {@code char}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
        CHAR_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
         * a string literal expression of type {@link String}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
        STRING_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
         * Used for instances of {@link LiteralTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
         * the use of {@code null}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
        NULL_LITERAL(LiteralTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
06bc494ca11e Initial load
duke
parents:
diff changeset
   540
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   541
         * Used for instances of {@link WildcardTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   542
         * an unbounded wildcard type argument.
06bc494ca11e Initial load
duke
parents:
diff changeset
   543
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   544
        UNBOUNDED_WILDCARD(WildcardTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   545
06bc494ca11e Initial load
duke
parents:
diff changeset
   546
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
         * Used for instances of {@link WildcardTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
         * an extends bounded wildcard type argument.
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
        EXTENDS_WILDCARD(WildcardTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
         * Used for instances of {@link WildcardTree} representing
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
         * a super bounded wildcard type argument.
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
        SUPER_WILDCARD(WildcardTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
06bc494ca11e Initial load
duke
parents:
diff changeset
   558
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   559
         * Used for instances of {@link ErroneousTree}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   560
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   561
        ERRONEOUS(ErroneousTree.class),
06bc494ca11e Initial load
duke
parents:
diff changeset
   562
06bc494ca11e Initial load
duke
parents:
diff changeset
   563
        /**
6580
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   564
         * Used for instances of {@link ClassTree} representing interfaces.
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   565
         */
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   566
        INTERFACE(ClassTree.class),
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   567
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   568
        /**
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   569
         * Used for instances of {@link ClassTree} representing enums.
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   570
         */
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   571
        ENUM(ClassTree.class),
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   572
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   573
        /**
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   574
         * Used for instances of {@link ClassTree} representing annotation types.
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   575
         */
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   576
        ANNOTATION_TYPE(ClassTree.class),
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   577
d3d578d22cc7 6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents: 5848
diff changeset
   578
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
         * An implementation-reserved node. This is the not the node
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
         * you are looking for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
        OTHER(null);
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
06bc494ca11e Initial load
duke
parents:
diff changeset
   584
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
        Kind(Class<? extends Tree> intf) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
            associatedInterface = intf;
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
        public Class<? extends Tree> asInterface() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
            return associatedInterface;
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
        private final Class<? extends Tree> associatedInterface;
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
     * Gets the kind of this tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
     * @return the kind of this tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
    Kind getKind();
06bc494ca11e Initial load
duke
parents:
diff changeset
   602
06bc494ca11e Initial load
duke
parents:
diff changeset
   603
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   604
     * Accept method used to implement the visitor pattern.  The
06bc494ca11e Initial load
duke
parents:
diff changeset
   605
     * visitor pattern is used to implement operations on trees.
06bc494ca11e Initial load
duke
parents:
diff changeset
   606
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   607
     * @param <R> result type of this operation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
     * @param <D> type of additonal data.
06bc494ca11e Initial load
duke
parents:
diff changeset
   609
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
    <R,D> R accept(TreeVisitor<R,D> visitor, D data);
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
}