author | jlahoda |
Wed, 02 Oct 2019 10:59:40 +0200 | |
branch | JDK-8226585-branch |
changeset 58440 | 4c8a6d1d066c |
parent 58109 | ee07de0d2c16 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
55306 | 2 |
* Copyright (c) 2005, 2019, 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 |
/** |
|
58440
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
243 |
* {@preview Associated with switch expressions, a preview feature of |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
244 |
* the Java language. |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
245 |
* |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
246 |
* This enum constant is associated with <i>switch expressions</i>, a preview |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
247 |
* feature of the Java language. Preview features |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
248 |
* may be removed in a future release, or upgraded to permanent |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
249 |
* features of the Java language.} |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
250 |
* |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
251 |
* Used for instances of {@link SwitchExpressionTree}. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
252 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
253 |
* @since 12 |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
254 |
*/ |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
255 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
256 |
@SuppressWarnings("preview") |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
257 |
SWITCH_EXPRESSION(SwitchExpressionTree.class), |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
258 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
259 |
/** |
10 | 260 |
* Used for instances of {@link SynchronizedTree}. |
261 |
*/ |
|
262 |
SYNCHRONIZED(SynchronizedTree.class), |
|
263 |
||
264 |
/** |
|
265 |
* Used for instances of {@link ThrowTree}. |
|
266 |
*/ |
|
267 |
THROW(ThrowTree.class), |
|
268 |
||
269 |
/** |
|
270 |
* Used for instances of {@link TryTree}. |
|
271 |
*/ |
|
272 |
TRY(TryTree.class), |
|
273 |
||
274 |
/** |
|
275 |
* Used for instances of {@link ParameterizedTypeTree}. |
|
276 |
*/ |
|
277 |
PARAMETERIZED_TYPE(ParameterizedTypeTree.class), |
|
278 |
||
279 |
/** |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
280 |
* Used for instances of {@link UnionTypeTree}. |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
281 |
*/ |
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
282 |
UNION_TYPE(UnionTypeTree.class), |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
283 |
|
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
284 |
/** |
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
285 |
* Used for instances of {@link IntersectionTypeTree}. |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
286 |
*/ |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
287 |
INTERSECTION_TYPE(IntersectionTypeTree.class), |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
288 |
|
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
14541
diff
changeset
|
289 |
/** |
10 | 290 |
* Used for instances of {@link TypeCastTree}. |
291 |
*/ |
|
292 |
TYPE_CAST(TypeCastTree.class), |
|
293 |
||
294 |
/** |
|
295 |
* Used for instances of {@link TypeParameterTree}. |
|
296 |
*/ |
|
297 |
TYPE_PARAMETER(TypeParameterTree.class), |
|
298 |
||
299 |
/** |
|
300 |
* Used for instances of {@link VariableTree}. |
|
301 |
*/ |
|
302 |
VARIABLE(VariableTree.class), |
|
303 |
||
304 |
/** |
|
305 |
* Used for instances of {@link WhileLoopTree}. |
|
306 |
*/ |
|
307 |
WHILE_LOOP(WhileLoopTree.class), |
|
308 |
||
309 |
/** |
|
310 |
* Used for instances of {@link UnaryTree} representing postfix |
|
311 |
* increment operator {@code ++}. |
|
312 |
*/ |
|
313 |
POSTFIX_INCREMENT(UnaryTree.class), |
|
314 |
||
315 |
/** |
|
316 |
* Used for instances of {@link UnaryTree} representing postfix |
|
317 |
* decrement operator {@code --}. |
|
318 |
*/ |
|
319 |
POSTFIX_DECREMENT(UnaryTree.class), |
|
320 |
||
321 |
/** |
|
322 |
* Used for instances of {@link UnaryTree} representing prefix |
|
323 |
* increment operator {@code ++}. |
|
324 |
*/ |
|
325 |
PREFIX_INCREMENT(UnaryTree.class), |
|
326 |
||
327 |
/** |
|
328 |
* Used for instances of {@link UnaryTree} representing prefix |
|
329 |
* decrement operator {@code --}. |
|
330 |
*/ |
|
331 |
PREFIX_DECREMENT(UnaryTree.class), |
|
332 |
||
333 |
/** |
|
334 |
* Used for instances of {@link UnaryTree} representing unary plus |
|
335 |
* operator {@code +}. |
|
336 |
*/ |
|
337 |
UNARY_PLUS(UnaryTree.class), |
|
338 |
||
339 |
/** |
|
340 |
* Used for instances of {@link UnaryTree} representing unary minus |
|
341 |
* operator {@code -}. |
|
342 |
*/ |
|
343 |
UNARY_MINUS(UnaryTree.class), |
|
344 |
||
345 |
/** |
|
346 |
* Used for instances of {@link UnaryTree} representing bitwise |
|
347 |
* complement operator {@code ~}. |
|
348 |
*/ |
|
349 |
BITWISE_COMPLEMENT(UnaryTree.class), |
|
350 |
||
351 |
/** |
|
352 |
* Used for instances of {@link UnaryTree} representing logical |
|
353 |
* complement operator {@code !}. |
|
354 |
*/ |
|
355 |
LOGICAL_COMPLEMENT(UnaryTree.class), |
|
356 |
||
357 |
/** |
|
358 |
* Used for instances of {@link BinaryTree} representing |
|
359 |
* multiplication {@code *}. |
|
360 |
*/ |
|
361 |
MULTIPLY(BinaryTree.class), |
|
362 |
||
363 |
/** |
|
364 |
* Used for instances of {@link BinaryTree} representing |
|
365 |
* division {@code /}. |
|
366 |
*/ |
|
367 |
DIVIDE(BinaryTree.class), |
|
368 |
||
369 |
/** |
|
370 |
* Used for instances of {@link BinaryTree} representing |
|
371 |
* remainder {@code %}. |
|
372 |
*/ |
|
373 |
REMAINDER(BinaryTree.class), |
|
374 |
||
375 |
/** |
|
376 |
* Used for instances of {@link BinaryTree} representing |
|
377 |
* addition or string concatenation {@code +}. |
|
378 |
*/ |
|
379 |
PLUS(BinaryTree.class), |
|
380 |
||
381 |
/** |
|
382 |
* Used for instances of {@link BinaryTree} representing |
|
383 |
* subtraction {@code -}. |
|
384 |
*/ |
|
385 |
MINUS(BinaryTree.class), |
|
386 |
||
387 |
/** |
|
388 |
* Used for instances of {@link BinaryTree} representing |
|
389 |
* left shift {@code <<}. |
|
390 |
*/ |
|
391 |
LEFT_SHIFT(BinaryTree.class), |
|
392 |
||
393 |
/** |
|
394 |
* Used for instances of {@link BinaryTree} representing |
|
395 |
* right shift {@code >>}. |
|
396 |
*/ |
|
397 |
RIGHT_SHIFT(BinaryTree.class), |
|
398 |
||
399 |
/** |
|
400 |
* Used for instances of {@link BinaryTree} representing |
|
401 |
* unsigned right shift {@code >>>}. |
|
402 |
*/ |
|
403 |
UNSIGNED_RIGHT_SHIFT(BinaryTree.class), |
|
404 |
||
405 |
/** |
|
406 |
* Used for instances of {@link BinaryTree} representing |
|
407 |
* less-than {@code <}. |
|
408 |
*/ |
|
409 |
LESS_THAN(BinaryTree.class), |
|
410 |
||
411 |
/** |
|
412 |
* Used for instances of {@link BinaryTree} representing |
|
413 |
* greater-than {@code >}. |
|
414 |
*/ |
|
415 |
GREATER_THAN(BinaryTree.class), |
|
416 |
||
417 |
/** |
|
418 |
* Used for instances of {@link BinaryTree} representing |
|
419 |
* less-than-equal {@code <=}. |
|
420 |
*/ |
|
421 |
LESS_THAN_EQUAL(BinaryTree.class), |
|
422 |
||
423 |
/** |
|
424 |
* Used for instances of {@link BinaryTree} representing |
|
425 |
* greater-than-equal {@code >=}. |
|
426 |
*/ |
|
427 |
GREATER_THAN_EQUAL(BinaryTree.class), |
|
428 |
||
429 |
/** |
|
430 |
* Used for instances of {@link BinaryTree} representing |
|
431 |
* equal-to {@code ==}. |
|
432 |
*/ |
|
433 |
EQUAL_TO(BinaryTree.class), |
|
434 |
||
435 |
/** |
|
436 |
* Used for instances of {@link BinaryTree} representing |
|
437 |
* not-equal-to {@code !=}. |
|
438 |
*/ |
|
439 |
NOT_EQUAL_TO(BinaryTree.class), |
|
440 |
||
441 |
/** |
|
442 |
* Used for instances of {@link BinaryTree} representing |
|
443 |
* bitwise and logical "and" {@code &}. |
|
444 |
*/ |
|
445 |
AND(BinaryTree.class), |
|
446 |
||
447 |
/** |
|
448 |
* Used for instances of {@link BinaryTree} representing |
|
449 |
* bitwise and logical "xor" {@code ^}. |
|
450 |
*/ |
|
451 |
XOR(BinaryTree.class), |
|
452 |
||
453 |
/** |
|
454 |
* Used for instances of {@link BinaryTree} representing |
|
455 |
* bitwise and logical "or" {@code |}. |
|
456 |
*/ |
|
457 |
OR(BinaryTree.class), |
|
458 |
||
459 |
/** |
|
460 |
* Used for instances of {@link BinaryTree} representing |
|
461 |
* conditional-and {@code &&}. |
|
462 |
*/ |
|
463 |
CONDITIONAL_AND(BinaryTree.class), |
|
464 |
||
465 |
/** |
|
466 |
* Used for instances of {@link BinaryTree} representing |
|
467 |
* conditional-or {@code ||}. |
|
468 |
*/ |
|
469 |
CONDITIONAL_OR(BinaryTree.class), |
|
470 |
||
471 |
/** |
|
472 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
473 |
* multiplication assignment {@code *=}. |
|
474 |
*/ |
|
475 |
MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class), |
|
476 |
||
477 |
/** |
|
478 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
479 |
* division assignment {@code /=}. |
|
480 |
*/ |
|
481 |
DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class), |
|
482 |
||
483 |
/** |
|
484 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
485 |
* remainder assignment {@code %=}. |
|
486 |
*/ |
|
487 |
REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class), |
|
488 |
||
489 |
/** |
|
490 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
491 |
* addition or string concatenation assignment {@code +=}. |
|
492 |
*/ |
|
493 |
PLUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
494 |
||
495 |
/** |
|
496 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
497 |
* subtraction assignment {@code -=}. |
|
498 |
*/ |
|
499 |
MINUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
500 |
||
501 |
/** |
|
502 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
503 |
* left shift assignment {@code <<=}. |
|
504 |
*/ |
|
505 |
LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
506 |
||
507 |
/** |
|
508 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
509 |
* right shift assignment {@code >>=}. |
|
510 |
*/ |
|
511 |
RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
512 |
||
513 |
/** |
|
514 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
515 |
* unsigned right shift assignment {@code >>>=}. |
|
516 |
*/ |
|
517 |
UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
518 |
||
519 |
/** |
|
520 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
521 |
* bitwise and logical "and" assignment {@code &=}. |
|
522 |
*/ |
|
523 |
AND_ASSIGNMENT(CompoundAssignmentTree.class), |
|
524 |
||
525 |
/** |
|
526 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
527 |
* bitwise and logical "xor" assignment {@code ^=}. |
|
528 |
*/ |
|
529 |
XOR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
530 |
||
531 |
/** |
|
532 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
533 |
* bitwise and logical "or" assignment {@code |=}. |
|
534 |
*/ |
|
535 |
OR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
536 |
||
537 |
/** |
|
538 |
* Used for instances of {@link LiteralTree} representing |
|
539 |
* an integral literal expression of type {@code int}. |
|
540 |
*/ |
|
541 |
INT_LITERAL(LiteralTree.class), |
|
542 |
||
543 |
/** |
|
544 |
* Used for instances of {@link LiteralTree} representing |
|
545 |
* an integral literal expression of type {@code long}. |
|
546 |
*/ |
|
547 |
LONG_LITERAL(LiteralTree.class), |
|
548 |
||
549 |
/** |
|
550 |
* Used for instances of {@link LiteralTree} representing |
|
551 |
* a floating-point literal expression of type {@code float}. |
|
552 |
*/ |
|
553 |
FLOAT_LITERAL(LiteralTree.class), |
|
554 |
||
555 |
/** |
|
556 |
* Used for instances of {@link LiteralTree} representing |
|
557 |
* a floating-point literal expression of type {@code double}. |
|
558 |
*/ |
|
559 |
DOUBLE_LITERAL(LiteralTree.class), |
|
560 |
||
561 |
/** |
|
562 |
* Used for instances of {@link LiteralTree} representing |
|
563 |
* a boolean literal expression of type {@code boolean}. |
|
564 |
*/ |
|
565 |
BOOLEAN_LITERAL(LiteralTree.class), |
|
566 |
||
567 |
/** |
|
568 |
* Used for instances of {@link LiteralTree} representing |
|
569 |
* a character literal expression of type {@code char}. |
|
570 |
*/ |
|
571 |
CHAR_LITERAL(LiteralTree.class), |
|
572 |
||
573 |
/** |
|
574 |
* Used for instances of {@link LiteralTree} representing |
|
575 |
* a string literal expression of type {@link String}. |
|
576 |
*/ |
|
577 |
STRING_LITERAL(LiteralTree.class), |
|
578 |
||
579 |
/** |
|
580 |
* Used for instances of {@link LiteralTree} representing |
|
581 |
* the use of {@code null}. |
|
582 |
*/ |
|
583 |
NULL_LITERAL(LiteralTree.class), |
|
584 |
||
585 |
/** |
|
586 |
* Used for instances of {@link WildcardTree} representing |
|
587 |
* an unbounded wildcard type argument. |
|
588 |
*/ |
|
589 |
UNBOUNDED_WILDCARD(WildcardTree.class), |
|
590 |
||
591 |
/** |
|
592 |
* Used for instances of {@link WildcardTree} representing |
|
593 |
* an extends bounded wildcard type argument. |
|
594 |
*/ |
|
595 |
EXTENDS_WILDCARD(WildcardTree.class), |
|
596 |
||
597 |
/** |
|
598 |
* Used for instances of {@link WildcardTree} representing |
|
599 |
* a super bounded wildcard type argument. |
|
600 |
*/ |
|
601 |
SUPER_WILDCARD(WildcardTree.class), |
|
602 |
||
603 |
/** |
|
604 |
* Used for instances of {@link ErroneousTree}. |
|
605 |
*/ |
|
606 |
ERRONEOUS(ErroneousTree.class), |
|
607 |
||
608 |
/** |
|
6580
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
609 |
* 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
|
610 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
611 |
INTERFACE(ClassTree.class), |
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 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
614 |
* 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
|
615 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
616 |
ENUM(ClassTree.class), |
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 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
619 |
* 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
|
620 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
621 |
ANNOTATION_TYPE(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
622 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
623 |
/** |
36526 | 624 |
* Used for instances of {@link ModuleTree} representing module declarations. |
625 |
*/ |
|
626 |
MODULE(ModuleTree.class), |
|
627 |
||
628 |
/** |
|
629 |
* Used for instances of {@link ExportsTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
630 |
* exports directives in a module declaration. |
36526 | 631 |
*/ |
632 |
EXPORTS(ExportsTree.class), |
|
633 |
||
634 |
/** |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
635 |
* Used for instances of {@link ExportsTree} representing |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
636 |
* opens directives in a module declaration. |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
637 |
*/ |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
638 |
OPENS(OpensTree.class), |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
639 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
640 |
/** |
36526 | 641 |
* Used for instances of {@link ProvidesTree} representing |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
642 |
* provides directives in a module declaration. |
36526 | 643 |
*/ |
644 |
PROVIDES(ProvidesTree.class), |
|
645 |
||
646 |
/** |
|
647 |
* Used for instances of {@link RequiresTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
648 |
* requires directives in a module declaration. |
36526 | 649 |
*/ |
650 |
REQUIRES(RequiresTree.class), |
|
651 |
||
652 |
/** |
|
653 |
* Used for instances of {@link UsesTree} representing |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
654 |
* uses directives in a module declaration. |
36526 | 655 |
*/ |
656 |
USES(UsesTree.class), |
|
657 |
||
658 |
/** |
|
10 | 659 |
* An implementation-reserved node. This is the not the node |
660 |
* you are looking for. |
|
661 |
*/ |
|
55306 | 662 |
OTHER(null), |
663 |
||
664 |
/** |
|
58440
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
665 |
* {@preview Associated with switch expressions, a preview feature of |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
666 |
* the Java language. |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
667 |
* |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
668 |
* This enum constant is associated with <i>switch expressions</i>, a preview |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
669 |
* feature of the Java language. Preview features |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
670 |
* may be removed in a future release, or upgraded to permanent |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
671 |
* features of the Java language.} |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
672 |
* |
55306 | 673 |
* Used for instances of {@link YieldTree}. |
674 |
* |
|
675 |
* @since 13 |
|
676 |
*/ |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
677 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
678 |
@SuppressWarnings("preview") |
55306 | 679 |
YIELD(YieldTree.class); |
10 | 680 |
|
681 |
||
682 |
Kind(Class<? extends Tree> intf) { |
|
683 |
associatedInterface = intf; |
|
684 |
} |
|
685 |
||
25287 | 686 |
/** |
687 |
* Returns the associated interface type that uses this kind. |
|
688 |
* @return the associated interface |
|
689 |
*/ |
|
10 | 690 |
public Class<? extends Tree> asInterface() { |
691 |
return associatedInterface; |
|
692 |
} |
|
693 |
||
694 |
private final Class<? extends Tree> associatedInterface; |
|
695 |
} |
|
696 |
||
697 |
/** |
|
25287 | 698 |
* Returns the kind of this tree. |
10 | 699 |
* |
700 |
* @return the kind of this tree. |
|
701 |
*/ |
|
702 |
Kind getKind(); |
|
703 |
||
704 |
/** |
|
705 |
* Accept method used to implement the visitor pattern. The |
|
706 |
* visitor pattern is used to implement operations on trees. |
|
707 |
* |
|
708 |
* @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
|
709 |
* @param <D> type of additional data. |
25287 | 710 |
* @param visitor the visitor to be called |
711 |
* @param data a value to be passed to the visitor |
|
712 |
* @return the result returned from calling the visitor |
|
10 | 713 |
*/ |
714 |
<R,D> R accept(TreeVisitor<R,D> visitor, D data); |
|
715 |
} |