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