author | jlahoda |
Wed, 29 Aug 2018 09:36:17 +0200 | |
changeset 51563 | de411d537aae |
parent 47216 | 71c04702a3d5 |
child 55306 | ea43db53de91 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2005, 2016, 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 { |
|
25287 | 48 |
/** |
49 |
* Used for instances of {@link AnnotatedTypeTree} |
|
50 |
* representing annotated types. |
|
51 |
*/ |
|
15385 | 52 |
ANNOTATED_TYPE(AnnotatedTypeTree.class), |
53 |
||
10 | 54 |
/** |
15385 | 55 |
* Used for instances of {@link AnnotationTree} |
56 |
* representing declaration annotations. |
|
10 | 57 |
*/ |
58 |
ANNOTATION(AnnotationTree.class), |
|
59 |
||
60 |
/** |
|
15385 | 61 |
* Used for instances of {@link AnnotationTree} |
62 |
* representing type annotations. |
|
63 |
*/ |
|
64 |
TYPE_ANNOTATION(AnnotationTree.class), |
|
65 |
||
66 |
/** |
|
10 | 67 |
* Used for instances of {@link ArrayAccessTree}. |
68 |
*/ |
|
69 |
ARRAY_ACCESS(ArrayAccessTree.class), |
|
70 |
||
71 |
/** |
|
72 |
* Used for instances of {@link ArrayTypeTree}. |
|
73 |
*/ |
|
74 |
ARRAY_TYPE(ArrayTypeTree.class), |
|
75 |
||
76 |
/** |
|
77 |
* Used for instances of {@link AssertTree}. |
|
78 |
*/ |
|
79 |
ASSERT(AssertTree.class), |
|
80 |
||
81 |
/** |
|
82 |
* Used for instances of {@link AssignmentTree}. |
|
83 |
*/ |
|
84 |
ASSIGNMENT(AssignmentTree.class), |
|
85 |
||
86 |
/** |
|
87 |
* Used for instances of {@link BlockTree}. |
|
88 |
*/ |
|
89 |
BLOCK(BlockTree.class), |
|
90 |
||
91 |
/** |
|
92 |
* Used for instances of {@link BreakTree}. |
|
93 |
*/ |
|
94 |
BREAK(BreakTree.class), |
|
95 |
||
96 |
/** |
|
97 |
* Used for instances of {@link CaseTree}. |
|
98 |
*/ |
|
99 |
CASE(CaseTree.class), |
|
100 |
||
101 |
/** |
|
102 |
* Used for instances of {@link CatchTree}. |
|
103 |
*/ |
|
104 |
CATCH(CatchTree.class), |
|
105 |
||
106 |
/** |
|
6580
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
107 |
* Used for instances of {@link ClassTree} representing classes. |
10 | 108 |
*/ |
109 |
CLASS(ClassTree.class), |
|
110 |
||
111 |
/** |
|
112 |
* Used for instances of {@link CompilationUnitTree}. |
|
113 |
*/ |
|
114 |
COMPILATION_UNIT(CompilationUnitTree.class), |
|
115 |
||
116 |
/** |
|
117 |
* Used for instances of {@link ConditionalExpressionTree}. |
|
118 |
*/ |
|
119 |
CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class), |
|
120 |
||
121 |
/** |
|
122 |
* Used for instances of {@link ContinueTree}. |
|
123 |
*/ |
|
124 |
CONTINUE(ContinueTree.class), |
|
125 |
||
126 |
/** |
|
127 |
* Used for instances of {@link DoWhileLoopTree}. |
|
128 |
*/ |
|
129 |
DO_WHILE_LOOP(DoWhileLoopTree.class), |
|
130 |
||
131 |
/** |
|
132 |
* Used for instances of {@link EnhancedForLoopTree}. |
|
133 |
*/ |
|
134 |
ENHANCED_FOR_LOOP(EnhancedForLoopTree.class), |
|
135 |
||
136 |
/** |
|
137 |
* Used for instances of {@link ExpressionStatementTree}. |
|
138 |
*/ |
|
139 |
EXPRESSION_STATEMENT(ExpressionStatementTree.class), |
|
140 |
||
141 |
/** |
|
142 |
* Used for instances of {@link MemberSelectTree}. |
|
143 |
*/ |
|
144 |
MEMBER_SELECT(MemberSelectTree.class), |
|
145 |
||
146 |
/** |
|
11142 | 147 |
* Used for instances of {@link MemberReferenceTree}. |
148 |
*/ |
|
149 |
MEMBER_REFERENCE(MemberReferenceTree.class), |
|
150 |
||
151 |
/** |
|
10 | 152 |
* Used for instances of {@link ForLoopTree}. |
153 |
*/ |
|
154 |
FOR_LOOP(ForLoopTree.class), |
|
155 |
||
156 |
/** |
|
157 |
* Used for instances of {@link IdentifierTree}. |
|
158 |
*/ |
|
159 |
IDENTIFIER(IdentifierTree.class), |
|
160 |
||
161 |
/** |
|
162 |
* Used for instances of {@link IfTree}. |
|
163 |
*/ |
|
164 |
IF(IfTree.class), |
|
165 |
||
166 |
/** |
|
167 |
* Used for instances of {@link ImportTree}. |
|
168 |
*/ |
|
169 |
IMPORT(ImportTree.class), |
|
170 |
||
171 |
/** |
|
172 |
* Used for instances of {@link InstanceOfTree}. |
|
173 |
*/ |
|
174 |
INSTANCE_OF(InstanceOfTree.class), |
|
175 |
||
176 |
/** |
|
177 |
* Used for instances of {@link LabeledStatementTree}. |
|
178 |
*/ |
|
179 |
LABELED_STATEMENT(LabeledStatementTree.class), |
|
180 |
||
181 |
/** |
|
182 |
* Used for instances of {@link MethodTree}. |
|
183 |
*/ |
|
184 |
METHOD(MethodTree.class), |
|
185 |
||
186 |
/** |
|
187 |
* Used for instances of {@link MethodInvocationTree}. |
|
188 |
*/ |
|
189 |
METHOD_INVOCATION(MethodInvocationTree.class), |
|
190 |
||
191 |
/** |
|
192 |
* Used for instances of {@link ModifiersTree}. |
|
193 |
*/ |
|
194 |
MODIFIERS(ModifiersTree.class), |
|
195 |
||
196 |
/** |
|
197 |
* Used for instances of {@link NewArrayTree}. |
|
198 |
*/ |
|
199 |
NEW_ARRAY(NewArrayTree.class), |
|
200 |
||
201 |
/** |
|
202 |
* Used for instances of {@link NewClassTree}. |
|
203 |
*/ |
|
204 |
NEW_CLASS(NewClassTree.class), |
|
205 |
||
206 |
/** |
|
11141 | 207 |
* Used for instances of {@link LambdaExpressionTree}. |
208 |
*/ |
|
209 |
LAMBDA_EXPRESSION(LambdaExpressionTree.class), |
|
210 |
||
211 |
/** |
|
24069 | 212 |
* Used for instances of {@link PackageTree}. |
34912
954fa9df99c7
8146572: Update "@since 1.9" to "@since 9" to match java.version.specification [langtools]
jjg
parents:
25874
diff
changeset
|
213 |
* @since 9 |
24069 | 214 |
*/ |
215 |
PACKAGE(PackageTree.class), |
|
216 |
||
217 |
/** |
|
10 | 218 |
* Used for instances of {@link ParenthesizedTree}. |
219 |
*/ |
|
220 |
PARENTHESIZED(ParenthesizedTree.class), |
|
221 |
||
222 |
/** |
|
223 |
* Used for instances of {@link PrimitiveTypeTree}. |
|
224 |
*/ |
|
225 |
PRIMITIVE_TYPE(PrimitiveTypeTree.class), |
|
226 |
||
227 |
/** |
|
228 |
* Used for instances of {@link ReturnTree}. |
|
229 |
*/ |
|
230 |
RETURN(ReturnTree.class), |
|
231 |
||
232 |
/** |
|
233 |
* Used for instances of {@link EmptyStatementTree}. |
|
234 |
*/ |
|
235 |
EMPTY_STATEMENT(EmptyStatementTree.class), |
|
236 |
||
237 |
/** |
|
238 |
* Used for instances of {@link SwitchTree}. |
|
239 |
*/ |
|
240 |
SWITCH(SwitchTree.class), |
|
241 |
||
242 |
/** |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
243 |
* Used for instances of {@link SwitchExpressionTree}. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
244 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
245 |
* @since 12 |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
246 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
247 |
* @deprecated |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
248 |
* This enum constant is modeling switch expressions, |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
249 |
* which are part of a preview feature and may be removed |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
250 |
* if the preview feature is removed. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
251 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
252 |
@Deprecated(forRemoval=true, since="12") |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
253 |
@SuppressWarnings("removal") |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
254 |
SWITCH_EXPRESSION(SwitchExpressionTree.class), |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
255 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
256 |
/** |
10 | 257 |
* Used for instances of {@link SynchronizedTree}. |
258 |
*/ |
|
259 |
SYNCHRONIZED(SynchronizedTree.class), |
|
260 |
||
261 |
/** |
|
262 |
* Used for instances of {@link ThrowTree}. |
|
263 |
*/ |
|
264 |
THROW(ThrowTree.class), |
|
265 |
||
266 |
/** |
|
267 |
* Used for instances of {@link TryTree}. |
|
268 |
*/ |
|
269 |
TRY(TryTree.class), |
|
270 |
||
271 |
/** |
|
272 |
* Used for instances of {@link ParameterizedTypeTree}. |
|
273 |
*/ |
|
274 |
PARAMETERIZED_TYPE(ParameterizedTypeTree.class), |
|
275 |
||
276 |
/** |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
277 |
* Used for instances of {@link UnionTypeTree}. |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
278 |
*/ |
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
279 |
UNION_TYPE(UnionTypeTree.class), |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
280 |
|
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
281 |
/** |
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
282 |
* Used for instances of {@link IntersectionTypeTree}. |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
283 |
*/ |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
284 |
INTERSECTION_TYPE(IntersectionTypeTree.class), |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
285 |
|
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
286 |
/** |
10 | 287 |
* Used for instances of {@link TypeCastTree}. |
288 |
*/ |
|
289 |
TYPE_CAST(TypeCastTree.class), |
|
290 |
||
291 |
/** |
|
292 |
* Used for instances of {@link TypeParameterTree}. |
|
293 |
*/ |
|
294 |
TYPE_PARAMETER(TypeParameterTree.class), |
|
295 |
||
296 |
/** |
|
297 |
* Used for instances of {@link VariableTree}. |
|
298 |
*/ |
|
299 |
VARIABLE(VariableTree.class), |
|
300 |
||
301 |
/** |
|
302 |
* Used for instances of {@link WhileLoopTree}. |
|
303 |
*/ |
|
304 |
WHILE_LOOP(WhileLoopTree.class), |
|
305 |
||
306 |
/** |
|
307 |
* Used for instances of {@link UnaryTree} representing postfix |
|
308 |
* increment operator {@code ++}. |
|
309 |
*/ |
|
310 |
POSTFIX_INCREMENT(UnaryTree.class), |
|
311 |
||
312 |
/** |
|
313 |
* Used for instances of {@link UnaryTree} representing postfix |
|
314 |
* decrement operator {@code --}. |
|
315 |
*/ |
|
316 |
POSTFIX_DECREMENT(UnaryTree.class), |
|
317 |
||
318 |
/** |
|
319 |
* Used for instances of {@link UnaryTree} representing prefix |
|
320 |
* increment operator {@code ++}. |
|
321 |
*/ |
|
322 |
PREFIX_INCREMENT(UnaryTree.class), |
|
323 |
||
324 |
/** |
|
325 |
* Used for instances of {@link UnaryTree} representing prefix |
|
326 |
* decrement operator {@code --}. |
|
327 |
*/ |
|
328 |
PREFIX_DECREMENT(UnaryTree.class), |
|
329 |
||
330 |
/** |
|
331 |
* Used for instances of {@link UnaryTree} representing unary plus |
|
332 |
* operator {@code +}. |
|
333 |
*/ |
|
334 |
UNARY_PLUS(UnaryTree.class), |
|
335 |
||
336 |
/** |
|
337 |
* Used for instances of {@link UnaryTree} representing unary minus |
|
338 |
* operator {@code -}. |
|
339 |
*/ |
|
340 |
UNARY_MINUS(UnaryTree.class), |
|
341 |
||
342 |
/** |
|
343 |
* Used for instances of {@link UnaryTree} representing bitwise |
|
344 |
* complement operator {@code ~}. |
|
345 |
*/ |
|
346 |
BITWISE_COMPLEMENT(UnaryTree.class), |
|
347 |
||
348 |
/** |
|
349 |
* Used for instances of {@link UnaryTree} representing logical |
|
350 |
* complement operator {@code !}. |
|
351 |
*/ |
|
352 |
LOGICAL_COMPLEMENT(UnaryTree.class), |
|
353 |
||
354 |
/** |
|
355 |
* Used for instances of {@link BinaryTree} representing |
|
356 |
* multiplication {@code *}. |
|
357 |
*/ |
|
358 |
MULTIPLY(BinaryTree.class), |
|
359 |
||
360 |
/** |
|
361 |
* Used for instances of {@link BinaryTree} representing |
|
362 |
* division {@code /}. |
|
363 |
*/ |
|
364 |
DIVIDE(BinaryTree.class), |
|
365 |
||
366 |
/** |
|
367 |
* Used for instances of {@link BinaryTree} representing |
|
368 |
* remainder {@code %}. |
|
369 |
*/ |
|
370 |
REMAINDER(BinaryTree.class), |
|
371 |
||
372 |
/** |
|
373 |
* Used for instances of {@link BinaryTree} representing |
|
374 |
* addition or string concatenation {@code +}. |
|
375 |
*/ |
|
376 |
PLUS(BinaryTree.class), |
|
377 |
||
378 |
/** |
|
379 |
* Used for instances of {@link BinaryTree} representing |
|
380 |
* subtraction {@code -}. |
|
381 |
*/ |
|
382 |
MINUS(BinaryTree.class), |
|
383 |
||
384 |
/** |
|
385 |
* Used for instances of {@link BinaryTree} representing |
|
386 |
* left shift {@code <<}. |
|
387 |
*/ |
|
388 |
LEFT_SHIFT(BinaryTree.class), |
|
389 |
||
390 |
/** |
|
391 |
* Used for instances of {@link BinaryTree} representing |
|
392 |
* right shift {@code >>}. |
|
393 |
*/ |
|
394 |
RIGHT_SHIFT(BinaryTree.class), |
|
395 |
||
396 |
/** |
|
397 |
* Used for instances of {@link BinaryTree} representing |
|
398 |
* unsigned right shift {@code >>>}. |
|
399 |
*/ |
|
400 |
UNSIGNED_RIGHT_SHIFT(BinaryTree.class), |
|
401 |
||
402 |
/** |
|
403 |
* Used for instances of {@link BinaryTree} representing |
|
404 |
* less-than {@code <}. |
|
405 |
*/ |
|
406 |
LESS_THAN(BinaryTree.class), |
|
407 |
||
408 |
/** |
|
409 |
* Used for instances of {@link BinaryTree} representing |
|
410 |
* greater-than {@code >}. |
|
411 |
*/ |
|
412 |
GREATER_THAN(BinaryTree.class), |
|
413 |
||
414 |
/** |
|
415 |
* Used for instances of {@link BinaryTree} representing |
|
416 |
* less-than-equal {@code <=}. |
|
417 |
*/ |
|
418 |
LESS_THAN_EQUAL(BinaryTree.class), |
|
419 |
||
420 |
/** |
|
421 |
* Used for instances of {@link BinaryTree} representing |
|
422 |
* greater-than-equal {@code >=}. |
|
423 |
*/ |
|
424 |
GREATER_THAN_EQUAL(BinaryTree.class), |
|
425 |
||
426 |
/** |
|
427 |
* Used for instances of {@link BinaryTree} representing |
|
428 |
* equal-to {@code ==}. |
|
429 |
*/ |
|
430 |
EQUAL_TO(BinaryTree.class), |
|
431 |
||
432 |
/** |
|
433 |
* Used for instances of {@link BinaryTree} representing |
|
434 |
* not-equal-to {@code !=}. |
|
435 |
*/ |
|
436 |
NOT_EQUAL_TO(BinaryTree.class), |
|
437 |
||
438 |
/** |
|
439 |
* Used for instances of {@link BinaryTree} representing |
|
440 |
* bitwise and logical "and" {@code &}. |
|
441 |
*/ |
|
442 |
AND(BinaryTree.class), |
|
443 |
||
444 |
/** |
|
445 |
* Used for instances of {@link BinaryTree} representing |
|
446 |
* bitwise and logical "xor" {@code ^}. |
|
447 |
*/ |
|
448 |
XOR(BinaryTree.class), |
|
449 |
||
450 |
/** |
|
451 |
* Used for instances of {@link BinaryTree} representing |
|
452 |
* bitwise and logical "or" {@code |}. |
|
453 |
*/ |
|
454 |
OR(BinaryTree.class), |
|
455 |
||
456 |
/** |
|
457 |
* Used for instances of {@link BinaryTree} representing |
|
458 |
* conditional-and {@code &&}. |
|
459 |
*/ |
|
460 |
CONDITIONAL_AND(BinaryTree.class), |
|
461 |
||
462 |
/** |
|
463 |
* Used for instances of {@link BinaryTree} representing |
|
464 |
* conditional-or {@code ||}. |
|
465 |
*/ |
|
466 |
CONDITIONAL_OR(BinaryTree.class), |
|
467 |
||
468 |
/** |
|
469 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
470 |
* multiplication assignment {@code *=}. |
|
471 |
*/ |
|
472 |
MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class), |
|
473 |
||
474 |
/** |
|
475 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
476 |
* division assignment {@code /=}. |
|
477 |
*/ |
|
478 |
DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class), |
|
479 |
||
480 |
/** |
|
481 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
482 |
* remainder assignment {@code %=}. |
|
483 |
*/ |
|
484 |
REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class), |
|
485 |
||
486 |
/** |
|
487 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
488 |
* addition or string concatenation assignment {@code +=}. |
|
489 |
*/ |
|
490 |
PLUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
491 |
||
492 |
/** |
|
493 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
494 |
* subtraction assignment {@code -=}. |
|
495 |
*/ |
|
496 |
MINUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
497 |
||
498 |
/** |
|
499 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
500 |
* left shift assignment {@code <<=}. |
|
501 |
*/ |
|
502 |
LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
503 |
||
504 |
/** |
|
505 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
506 |
* right shift assignment {@code >>=}. |
|
507 |
*/ |
|
508 |
RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
509 |
||
510 |
/** |
|
511 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
512 |
* unsigned right shift assignment {@code >>>=}. |
|
513 |
*/ |
|
514 |
UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
515 |
||
516 |
/** |
|
517 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
518 |
* bitwise and logical "and" assignment {@code &=}. |
|
519 |
*/ |
|
520 |
AND_ASSIGNMENT(CompoundAssignmentTree.class), |
|
521 |
||
522 |
/** |
|
523 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
524 |
* bitwise and logical "xor" assignment {@code ^=}. |
|
525 |
*/ |
|
526 |
XOR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
527 |
||
528 |
/** |
|
529 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
530 |
* bitwise and logical "or" assignment {@code |=}. |
|
531 |
*/ |
|
532 |
OR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
533 |
||
534 |
/** |
|
535 |
* Used for instances of {@link LiteralTree} representing |
|
536 |
* an integral literal expression of type {@code int}. |
|
537 |
*/ |
|
538 |
INT_LITERAL(LiteralTree.class), |
|
539 |
||
540 |
/** |
|
541 |
* Used for instances of {@link LiteralTree} representing |
|
542 |
* an integral literal expression of type {@code long}. |
|
543 |
*/ |
|
544 |
LONG_LITERAL(LiteralTree.class), |
|
545 |
||
546 |
/** |
|
547 |
* Used for instances of {@link LiteralTree} representing |
|
548 |
* a floating-point literal expression of type {@code float}. |
|
549 |
*/ |
|
550 |
FLOAT_LITERAL(LiteralTree.class), |
|
551 |
||
552 |
/** |
|
553 |
* Used for instances of {@link LiteralTree} representing |
|
554 |
* a floating-point literal expression of type {@code double}. |
|
555 |
*/ |
|
556 |
DOUBLE_LITERAL(LiteralTree.class), |
|
557 |
||
558 |
/** |
|
559 |
* Used for instances of {@link LiteralTree} representing |
|
560 |
* a boolean literal expression of type {@code boolean}. |
|
561 |
*/ |
|
562 |
BOOLEAN_LITERAL(LiteralTree.class), |
|
563 |
||
564 |
/** |
|
565 |
* Used for instances of {@link LiteralTree} representing |
|
566 |
* a character literal expression of type {@code char}. |
|
567 |
*/ |
|
568 |
CHAR_LITERAL(LiteralTree.class), |
|
569 |
||
570 |
/** |
|
571 |
* Used for instances of {@link LiteralTree} representing |
|
572 |
* a string literal expression of type {@link String}. |
|
573 |
*/ |
|
574 |
STRING_LITERAL(LiteralTree.class), |
|
575 |
||
576 |
/** |
|
577 |
* Used for instances of {@link LiteralTree} representing |
|
578 |
* the use of {@code null}. |
|
579 |
*/ |
|
580 |
NULL_LITERAL(LiteralTree.class), |
|
581 |
||
582 |
/** |
|
583 |
* Used for instances of {@link WildcardTree} representing |
|
584 |
* an unbounded wildcard type argument. |
|
585 |
*/ |
|
586 |
UNBOUNDED_WILDCARD(WildcardTree.class), |
|
587 |
||
588 |
/** |
|
589 |
* Used for instances of {@link WildcardTree} representing |
|
590 |
* an extends bounded wildcard type argument. |
|
591 |
*/ |
|
592 |
EXTENDS_WILDCARD(WildcardTree.class), |
|
593 |
||
594 |
/** |
|
595 |
* Used for instances of {@link WildcardTree} representing |
|
596 |
* a super bounded wildcard type argument. |
|
597 |
*/ |
|
598 |
SUPER_WILDCARD(WildcardTree.class), |
|
599 |
||
600 |
/** |
|
601 |
* Used for instances of {@link ErroneousTree}. |
|
602 |
*/ |
|
603 |
ERRONEOUS(ErroneousTree.class), |
|
604 |
||
605 |
/** |
|
6580
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
606 |
* 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
|
607 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
608 |
INTERFACE(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
609 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
610 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
611 |
* 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
|
612 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
613 |
ENUM(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
614 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
615 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
616 |
* 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
|
617 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
618 |
ANNOTATION_TYPE(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
619 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
620 |
/** |
36526 | 621 |
* Used for instances of {@link ModuleTree} representing module declarations. |
622 |
*/ |
|
623 |
MODULE(ModuleTree.class), |
|
624 |
||
625 |
/** |
|
626 |
* Used for instances of {@link ExportsTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
627 |
* exports directives in a module declaration. |
36526 | 628 |
*/ |
629 |
EXPORTS(ExportsTree.class), |
|
630 |
||
631 |
/** |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
632 |
* Used for instances of {@link ExportsTree} representing |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
633 |
* opens directives in a module declaration. |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
634 |
*/ |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
635 |
OPENS(OpensTree.class), |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
636 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
637 |
/** |
36526 | 638 |
* Used for instances of {@link ProvidesTree} representing |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
639 |
* provides directives in a module declaration. |
36526 | 640 |
*/ |
641 |
PROVIDES(ProvidesTree.class), |
|
642 |
||
643 |
/** |
|
644 |
* Used for instances of {@link RequiresTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
645 |
* requires directives in a module declaration. |
36526 | 646 |
*/ |
647 |
REQUIRES(RequiresTree.class), |
|
648 |
||
649 |
/** |
|
650 |
* Used for instances of {@link UsesTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
651 |
* uses directives in a module declaration. |
36526 | 652 |
*/ |
653 |
USES(UsesTree.class), |
|
654 |
||
655 |
/** |
|
10 | 656 |
* An implementation-reserved node. This is the not the node |
657 |
* you are looking for. |
|
658 |
*/ |
|
659 |
OTHER(null); |
|
660 |
||
661 |
||
662 |
Kind(Class<? extends Tree> intf) { |
|
663 |
associatedInterface = intf; |
|
664 |
} |
|
665 |
||
25287 | 666 |
/** |
667 |
* Returns the associated interface type that uses this kind. |
|
668 |
* @return the associated interface |
|
669 |
*/ |
|
10 | 670 |
public Class<? extends Tree> asInterface() { |
671 |
return associatedInterface; |
|
672 |
} |
|
673 |
||
674 |
private final Class<? extends Tree> associatedInterface; |
|
675 |
} |
|
676 |
||
677 |
/** |
|
25287 | 678 |
* Returns the kind of this tree. |
10 | 679 |
* |
680 |
* @return the kind of this tree. |
|
681 |
*/ |
|
682 |
Kind getKind(); |
|
683 |
||
684 |
/** |
|
685 |
* Accept method used to implement the visitor pattern. The |
|
686 |
* visitor pattern is used to implement operations on trees. |
|
687 |
* |
|
688 |
* @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
|
689 |
* @param <D> type of additional data. |
25287 | 690 |
* @param visitor the visitor to be called |
691 |
* @param data a value to be passed to the visitor |
|
692 |
* @return the result returned from calling the visitor |
|
10 | 693 |
*/ |
694 |
<R,D> R accept(TreeVisitor<R,D> visitor, D data); |
|
695 |
} |