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