author | jlahoda |
Thu, 12 Sep 2019 17:47:24 +0200 | |
branch | JDK-8226585-branch |
changeset 58109 | ee07de0d2c16 |
parent 55306 | ea43db53de91 |
child 58440 | 4c8a6d1d066c |
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.util; |
|
27 |
||
28 |
import com.sun.source.tree.*; |
|
29 |
||
30 |
/** |
|
31 |
* A simple visitor for tree nodes. |
|
32 |
* |
|
25287 | 33 |
* @param <R> the return type of this visitor's methods. Use {@link |
34 |
* Void} for visitors that do not need to return results. |
|
35 |
* @param <P> the type of the additional parameter to this visitor's |
|
36 |
* methods. Use {@code Void} for visitors that do not need an |
|
37 |
* additional parameter. |
|
38 |
* |
|
10 | 39 |
* @author Peter von der Ahé |
40 |
* @since 1.6 |
|
41 |
*/ |
|
42 |
public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> { |
|
25287 | 43 |
/** |
44 |
* The default value, returned by the {@link #defaultAction default action}. |
|
45 |
*/ |
|
10 | 46 |
protected final R DEFAULT_VALUE; |
47 |
||
25287 | 48 |
/** |
49 |
* Creates a visitor, with a DEFAULT_VALUE of {@code null}. |
|
50 |
*/ |
|
10 | 51 |
protected SimpleTreeVisitor() { |
52 |
DEFAULT_VALUE = null; |
|
53 |
} |
|
54 |
||
25287 | 55 |
/** |
56 |
* Creates a visitor, with a specified DEFAULT_VALUE. |
|
57 |
* @param defaultValue the default value to be returned by the default action. |
|
58 |
*/ |
|
10 | 59 |
protected SimpleTreeVisitor(R defaultValue) { |
60 |
DEFAULT_VALUE = defaultValue; |
|
61 |
} |
|
62 |
||
25287 | 63 |
/** |
64 |
* The default action, used by all visit methods that are not overridden. |
|
65 |
* @param node the node being visited |
|
66 |
* @param p the parameter value passed to the visit method |
|
67 |
* @return the result value to be returned from the visit method |
|
68 |
*/ |
|
10 | 69 |
protected R defaultAction(Tree node, P p) { |
70 |
return DEFAULT_VALUE; |
|
71 |
} |
|
72 |
||
25287 | 73 |
/** |
74 |
* Invokes the appropriate visit method specific to the type of the node. |
|
75 |
* @param node the node on which to dispatch |
|
76 |
* @param p a parameter to be passed to the appropriate visit method |
|
77 |
* @return the value returns from the appropriate visit method |
|
78 |
*/ |
|
10 | 79 |
public final R visit(Tree node, P p) { |
80 |
return (node == null) ? null : node.accept(this, p); |
|
81 |
} |
|
82 |
||
25287 | 83 |
/** |
84 |
* Invokes the appropriate visit method on each of a sequence of nodes. |
|
85 |
* @param nodes the nodes on which to dispatch |
|
86 |
* @param p a parameter value to be passed to each appropriate visit method |
|
87 |
* @return the value return from the last of the visit methods, or null |
|
88 |
* if none were called. |
|
89 |
*/ |
|
10 | 90 |
public final R visit(Iterable<? extends Tree> nodes, P p) { |
91 |
R r = null; |
|
92 |
if (nodes != null) |
|
93 |
for (Tree node : nodes) |
|
94 |
r = visit(node, p); |
|
95 |
return r; |
|
96 |
} |
|
97 |
||
25287 | 98 |
/** |
99 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
100 |
* |
|
101 |
* @param node {@inheritDoc} |
|
102 |
* @param p {@inheritDoc} |
|
103 |
* @return the result of {@code defaultAction} |
|
104 |
*/ |
|
105 |
@Override |
|
10 | 106 |
public R visitCompilationUnit(CompilationUnitTree node, P p) { |
107 |
return defaultAction(node, p); |
|
108 |
} |
|
109 |
||
25287 | 110 |
/** |
111 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
112 |
* |
|
113 |
* @param node {@inheritDoc} |
|
114 |
* @param p {@inheritDoc} |
|
115 |
* @return the result of {@code defaultAction} |
|
116 |
*/ |
|
117 |
@Override |
|
24069 | 118 |
public R visitPackage(PackageTree node, P p) { |
119 |
return defaultAction(node, p); |
|
120 |
} |
|
121 |
||
25287 | 122 |
/** |
123 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
124 |
* |
|
125 |
* @param node {@inheritDoc} |
|
126 |
* @param p {@inheritDoc} |
|
127 |
* @return the result of {@code defaultAction} |
|
128 |
*/ |
|
129 |
@Override |
|
10 | 130 |
public R visitImport(ImportTree node, P p) { |
131 |
return defaultAction(node, p); |
|
132 |
} |
|
133 |
||
25287 | 134 |
/** |
135 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
136 |
* |
|
137 |
* @param node {@inheritDoc} |
|
138 |
* @param p {@inheritDoc} |
|
139 |
* @return the result of {@code defaultAction} |
|
140 |
*/ |
|
141 |
@Override |
|
10 | 142 |
public R visitClass(ClassTree node, P p) { |
143 |
return defaultAction(node, p); |
|
144 |
} |
|
145 |
||
25287 | 146 |
/** |
147 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
148 |
* |
|
149 |
* @param node {@inheritDoc} |
|
150 |
* @param p {@inheritDoc} |
|
151 |
* @return the result of {@code defaultAction} |
|
152 |
*/ |
|
153 |
@Override |
|
10 | 154 |
public R visitMethod(MethodTree node, P p) { |
155 |
return defaultAction(node, p); |
|
156 |
} |
|
157 |
||
25287 | 158 |
/** |
159 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
160 |
* |
|
161 |
* @param node {@inheritDoc} |
|
162 |
* @param p {@inheritDoc} |
|
163 |
* @return the result of {@code defaultAction} |
|
164 |
*/ |
|
165 |
@Override |
|
10 | 166 |
public R visitVariable(VariableTree node, P p) { |
167 |
return defaultAction(node, p); |
|
168 |
} |
|
169 |
||
25287 | 170 |
/** |
171 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
172 |
* |
|
173 |
* @param node {@inheritDoc} |
|
174 |
* @param p {@inheritDoc} |
|
175 |
* @return the result of {@code defaultAction} |
|
176 |
*/ |
|
177 |
@Override |
|
10 | 178 |
public R visitEmptyStatement(EmptyStatementTree node, P p) { |
179 |
return defaultAction(node, p); |
|
180 |
} |
|
181 |
||
25287 | 182 |
/** |
183 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
184 |
* |
|
185 |
* @param node {@inheritDoc} |
|
186 |
* @param p {@inheritDoc} |
|
187 |
* @return the result of {@code defaultAction} |
|
188 |
*/ |
|
189 |
@Override |
|
10 | 190 |
public R visitBlock(BlockTree node, P p) { |
191 |
return defaultAction(node, p); |
|
192 |
} |
|
193 |
||
25287 | 194 |
/** |
195 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
196 |
* |
|
197 |
* @param node {@inheritDoc} |
|
198 |
* @param p {@inheritDoc} |
|
199 |
* @return the result of {@code defaultAction} |
|
200 |
*/ |
|
201 |
@Override |
|
10 | 202 |
public R visitDoWhileLoop(DoWhileLoopTree node, P p) { |
203 |
return defaultAction(node, p); |
|
204 |
} |
|
205 |
||
25287 | 206 |
/** |
207 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
208 |
* |
|
209 |
* @param node {@inheritDoc} |
|
210 |
* @param p {@inheritDoc} |
|
211 |
* @return the result of {@code defaultAction} |
|
212 |
*/ |
|
213 |
@Override |
|
10 | 214 |
public R visitWhileLoop(WhileLoopTree node, P p) { |
215 |
return defaultAction(node, p); |
|
216 |
} |
|
217 |
||
25287 | 218 |
/** |
219 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
220 |
* |
|
221 |
* @param node {@inheritDoc} |
|
222 |
* @param p {@inheritDoc} |
|
223 |
* @return the result of {@code defaultAction} |
|
224 |
*/ |
|
225 |
@Override |
|
10 | 226 |
public R visitForLoop(ForLoopTree node, P p) { |
227 |
return defaultAction(node, p); |
|
228 |
} |
|
229 |
||
25287 | 230 |
/** |
231 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
232 |
* |
|
233 |
* @param node {@inheritDoc} |
|
234 |
* @param p {@inheritDoc} |
|
235 |
* @return the result of {@code defaultAction} |
|
236 |
*/ |
|
237 |
@Override |
|
10 | 238 |
public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { |
239 |
return defaultAction(node, p); |
|
240 |
} |
|
241 |
||
25287 | 242 |
/** |
243 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
244 |
* |
|
245 |
* @param node {@inheritDoc} |
|
246 |
* @param p {@inheritDoc} |
|
247 |
* @return the result of {@code defaultAction} |
|
248 |
*/ |
|
249 |
@Override |
|
10 | 250 |
public R visitLabeledStatement(LabeledStatementTree node, P p) { |
251 |
return defaultAction(node, p); |
|
252 |
} |
|
253 |
||
25287 | 254 |
/** |
255 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
256 |
* |
|
257 |
* @param node {@inheritDoc} |
|
258 |
* @param p {@inheritDoc} |
|
259 |
* @return the result of {@code defaultAction} |
|
260 |
*/ |
|
261 |
@Override |
|
10 | 262 |
public R visitSwitch(SwitchTree node, P p) { |
263 |
return defaultAction(node, p); |
|
264 |
} |
|
265 |
||
25287 | 266 |
/** |
267 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
268 |
* |
|
269 |
* @param node {@inheritDoc} |
|
270 |
* @param p {@inheritDoc} |
|
271 |
* @return the result of {@code defaultAction} |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
272 |
* |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
273 |
* @preview |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
274 |
* This method is modeling switch expressions, |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
275 |
* which are part of a preview feature and may be removed |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
276 |
* if the preview feature is removed. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
277 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
278 |
@Override |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
279 |
@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
|
280 |
@SuppressWarnings("preview") |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
281 |
public R visitSwitchExpression(SwitchExpressionTree node, P p) { |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
282 |
return defaultAction(node, p); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
283 |
} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
284 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
285 |
/** |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
286 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
287 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
288 |
* @param node {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
289 |
* @param p {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
290 |
* @return the result of {@code defaultAction} |
25287 | 291 |
*/ |
292 |
@Override |
|
10 | 293 |
public R visitCase(CaseTree node, P p) { |
294 |
return defaultAction(node, p); |
|
295 |
} |
|
296 |
||
25287 | 297 |
/** |
298 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
299 |
* |
|
300 |
* @param node {@inheritDoc} |
|
301 |
* @param p {@inheritDoc} |
|
302 |
* @return the result of {@code defaultAction} |
|
303 |
*/ |
|
304 |
@Override |
|
10 | 305 |
public R visitSynchronized(SynchronizedTree node, P p) { |
306 |
return defaultAction(node, p); |
|
307 |
} |
|
308 |
||
25287 | 309 |
/** |
310 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
311 |
* |
|
312 |
* @param node {@inheritDoc} |
|
313 |
* @param p {@inheritDoc} |
|
314 |
* @return the result of {@code defaultAction} |
|
315 |
*/ |
|
316 |
@Override |
|
10 | 317 |
public R visitTry(TryTree node, P p) { |
318 |
return defaultAction(node, p); |
|
319 |
} |
|
320 |
||
25287 | 321 |
/** |
322 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
323 |
* |
|
324 |
* @param node {@inheritDoc} |
|
325 |
* @param p {@inheritDoc} |
|
326 |
* @return the result of {@code defaultAction} |
|
327 |
*/ |
|
328 |
@Override |
|
10 | 329 |
public R visitCatch(CatchTree node, P p) { |
330 |
return defaultAction(node, p); |
|
331 |
} |
|
332 |
||
25287 | 333 |
/** |
334 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
335 |
* |
|
336 |
* @param node {@inheritDoc} |
|
337 |
* @param p {@inheritDoc} |
|
338 |
* @return the result of {@code defaultAction} |
|
339 |
*/ |
|
340 |
@Override |
|
10 | 341 |
public R visitConditionalExpression(ConditionalExpressionTree node, P p) { |
342 |
return defaultAction(node, p); |
|
343 |
} |
|
344 |
||
25287 | 345 |
/** |
346 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
347 |
* |
|
348 |
* @param node {@inheritDoc} |
|
349 |
* @param p {@inheritDoc} |
|
350 |
* @return the result of {@code defaultAction} |
|
351 |
*/ |
|
352 |
@Override |
|
10 | 353 |
public R visitIf(IfTree node, P p) { |
354 |
return defaultAction(node, p); |
|
355 |
} |
|
356 |
||
25287 | 357 |
/** |
358 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
359 |
* |
|
360 |
* @param node {@inheritDoc} |
|
361 |
* @param p {@inheritDoc} |
|
362 |
* @return the result of {@code defaultAction} |
|
363 |
*/ |
|
364 |
@Override |
|
10 | 365 |
public R visitExpressionStatement(ExpressionStatementTree node, P p) { |
366 |
return defaultAction(node, p); |
|
367 |
} |
|
368 |
||
25287 | 369 |
/** |
370 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
371 |
* |
|
372 |
* @param node {@inheritDoc} |
|
373 |
* @param p {@inheritDoc} |
|
374 |
* @return the result of {@code defaultAction} |
|
375 |
*/ |
|
376 |
@Override |
|
10 | 377 |
public R visitBreak(BreakTree node, P p) { |
378 |
return defaultAction(node, p); |
|
379 |
} |
|
380 |
||
25287 | 381 |
/** |
382 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
383 |
* |
|
384 |
* @param node {@inheritDoc} |
|
385 |
* @param p {@inheritDoc} |
|
386 |
* @return the result of {@code defaultAction} |
|
387 |
*/ |
|
388 |
@Override |
|
10 | 389 |
public R visitContinue(ContinueTree node, P p) { |
390 |
return defaultAction(node, p); |
|
391 |
} |
|
392 |
||
25287 | 393 |
/** |
394 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
395 |
* |
|
396 |
* @param node {@inheritDoc} |
|
397 |
* @param p {@inheritDoc} |
|
398 |
* @return the result of {@code defaultAction} |
|
399 |
*/ |
|
400 |
@Override |
|
10 | 401 |
public R visitReturn(ReturnTree node, P p) { |
402 |
return defaultAction(node, p); |
|
403 |
} |
|
404 |
||
25287 | 405 |
/** |
406 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
407 |
* |
|
408 |
* @param node {@inheritDoc} |
|
409 |
* @param p {@inheritDoc} |
|
410 |
* @return the result of {@code defaultAction} |
|
411 |
*/ |
|
412 |
@Override |
|
10 | 413 |
public R visitThrow(ThrowTree node, P p) { |
414 |
return defaultAction(node, p); |
|
415 |
} |
|
416 |
||
25287 | 417 |
/** |
418 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
419 |
* |
|
420 |
* @param node {@inheritDoc} |
|
421 |
* @param p {@inheritDoc} |
|
422 |
* @return the result of {@code defaultAction} |
|
423 |
*/ |
|
424 |
@Override |
|
10 | 425 |
public R visitAssert(AssertTree node, P p) { |
426 |
return defaultAction(node, p); |
|
427 |
} |
|
428 |
||
25287 | 429 |
/** |
430 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
431 |
* |
|
432 |
* @param node {@inheritDoc} |
|
433 |
* @param p {@inheritDoc} |
|
434 |
* @return the result of {@code defaultAction} |
|
435 |
*/ |
|
436 |
@Override |
|
10 | 437 |
public R visitMethodInvocation(MethodInvocationTree node, P p) { |
438 |
return defaultAction(node, p); |
|
439 |
} |
|
440 |
||
25287 | 441 |
/** |
442 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
443 |
* |
|
444 |
* @param node {@inheritDoc} |
|
445 |
* @param p {@inheritDoc} |
|
446 |
* @return the result of {@code defaultAction} |
|
447 |
*/ |
|
448 |
@Override |
|
10 | 449 |
public R visitNewClass(NewClassTree node, P p) { |
450 |
return defaultAction(node, p); |
|
451 |
} |
|
452 |
||
25287 | 453 |
/** |
454 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
455 |
* |
|
456 |
* @param node {@inheritDoc} |
|
457 |
* @param p {@inheritDoc} |
|
458 |
* @return the result of {@code defaultAction} |
|
459 |
*/ |
|
460 |
@Override |
|
10 | 461 |
public R visitNewArray(NewArrayTree node, P p) { |
462 |
return defaultAction(node, p); |
|
463 |
} |
|
464 |
||
25287 | 465 |
/** |
466 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
467 |
* |
|
468 |
* @param node {@inheritDoc} |
|
469 |
* @param p {@inheritDoc} |
|
470 |
* @return the result of {@code defaultAction} |
|
471 |
*/ |
|
472 |
@Override |
|
11141 | 473 |
public R visitLambdaExpression(LambdaExpressionTree node, P p) { |
474 |
return defaultAction(node, p); |
|
475 |
} |
|
476 |
||
25287 | 477 |
/** |
478 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
479 |
* |
|
480 |
* @param node {@inheritDoc} |
|
481 |
* @param p {@inheritDoc} |
|
482 |
* @return the result of {@code defaultAction} |
|
483 |
*/ |
|
484 |
@Override |
|
10 | 485 |
public R visitParenthesized(ParenthesizedTree node, P p) { |
486 |
return defaultAction(node, p); |
|
487 |
} |
|
488 |
||
25287 | 489 |
/** |
490 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
491 |
* |
|
492 |
* @param node {@inheritDoc} |
|
493 |
* @param p {@inheritDoc} |
|
494 |
* @return the result of {@code defaultAction} |
|
495 |
*/ |
|
496 |
@Override |
|
10 | 497 |
public R visitAssignment(AssignmentTree node, P p) { |
498 |
return defaultAction(node, p); |
|
499 |
} |
|
500 |
||
25287 | 501 |
/** |
502 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
503 |
* |
|
504 |
* @param node {@inheritDoc} |
|
505 |
* @param p {@inheritDoc} |
|
506 |
* @return the result of {@code defaultAction} |
|
507 |
*/ |
|
508 |
@Override |
|
10 | 509 |
public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { |
510 |
return defaultAction(node, p); |
|
511 |
} |
|
512 |
||
25287 | 513 |
/** |
514 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
515 |
* |
|
516 |
* @param node {@inheritDoc} |
|
517 |
* @param p {@inheritDoc} |
|
518 |
* @return the result of {@code defaultAction} |
|
519 |
*/ |
|
520 |
@Override |
|
10 | 521 |
public R visitUnary(UnaryTree node, P p) { |
522 |
return defaultAction(node, p); |
|
523 |
} |
|
524 |
||
25287 | 525 |
/** |
526 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
527 |
* |
|
528 |
* @param node {@inheritDoc} |
|
529 |
* @param p {@inheritDoc} |
|
530 |
* @return the result of {@code defaultAction} |
|
531 |
*/ |
|
532 |
@Override |
|
10 | 533 |
public R visitBinary(BinaryTree node, P p) { |
534 |
return defaultAction(node, p); |
|
535 |
} |
|
536 |
||
25287 | 537 |
/** |
538 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
539 |
* |
|
540 |
* @param node {@inheritDoc} |
|
541 |
* @param p {@inheritDoc} |
|
542 |
* @return the result of {@code defaultAction} |
|
543 |
*/ |
|
544 |
@Override |
|
10 | 545 |
public R visitTypeCast(TypeCastTree node, P p) { |
546 |
return defaultAction(node, p); |
|
547 |
} |
|
548 |
||
25287 | 549 |
/** |
550 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
551 |
* |
|
552 |
* @param node {@inheritDoc} |
|
553 |
* @param p {@inheritDoc} |
|
554 |
* @return the result of {@code defaultAction} |
|
555 |
*/ |
|
556 |
@Override |
|
10 | 557 |
public R visitInstanceOf(InstanceOfTree node, P p) { |
558 |
return defaultAction(node, p); |
|
559 |
} |
|
560 |
||
25287 | 561 |
/** |
562 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
563 |
* |
|
564 |
* @param node {@inheritDoc} |
|
565 |
* @param p {@inheritDoc} |
|
566 |
* @return the result of {@code defaultAction} |
|
567 |
*/ |
|
568 |
@Override |
|
10 | 569 |
public R visitArrayAccess(ArrayAccessTree node, P p) { |
570 |
return defaultAction(node, p); |
|
571 |
} |
|
572 |
||
25287 | 573 |
/** |
574 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
575 |
* |
|
576 |
* @param node {@inheritDoc} |
|
577 |
* @param p {@inheritDoc} |
|
578 |
* @return the result of {@code defaultAction} |
|
579 |
*/ |
|
580 |
@Override |
|
10 | 581 |
public R visitMemberSelect(MemberSelectTree node, P p) { |
582 |
return defaultAction(node, p); |
|
583 |
} |
|
584 |
||
25287 | 585 |
/** |
586 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
587 |
* |
|
588 |
* @param node {@inheritDoc} |
|
589 |
* @param p {@inheritDoc} |
|
590 |
* @return the result of {@code defaultAction} |
|
591 |
*/ |
|
592 |
@Override |
|
11142 | 593 |
public R visitMemberReference(MemberReferenceTree node, P p) { |
594 |
return defaultAction(node, p); |
|
595 |
} |
|
596 |
||
25287 | 597 |
/** |
598 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
599 |
* |
|
600 |
* @param node {@inheritDoc} |
|
601 |
* @param p {@inheritDoc} |
|
602 |
* @return the result of {@code defaultAction} |
|
603 |
*/ |
|
604 |
@Override |
|
10 | 605 |
public R visitIdentifier(IdentifierTree node, P p) { |
606 |
return defaultAction(node, p); |
|
607 |
} |
|
608 |
||
25287 | 609 |
/** |
610 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
611 |
* |
|
612 |
* @param node {@inheritDoc} |
|
613 |
* @param p {@inheritDoc} |
|
614 |
* @return the result of {@code defaultAction} |
|
615 |
*/ |
|
616 |
@Override |
|
10 | 617 |
public R visitLiteral(LiteralTree node, P p) { |
618 |
return defaultAction(node, p); |
|
619 |
} |
|
620 |
||
25287 | 621 |
/** |
622 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
623 |
* |
|
624 |
* @param node {@inheritDoc} |
|
625 |
* @param p {@inheritDoc} |
|
626 |
* @return the result of {@code defaultAction} |
|
627 |
*/ |
|
628 |
@Override |
|
10 | 629 |
public R visitPrimitiveType(PrimitiveTypeTree node, P p) { |
630 |
return defaultAction(node, p); |
|
631 |
} |
|
632 |
||
25287 | 633 |
/** |
634 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
635 |
* |
|
636 |
* @param node {@inheritDoc} |
|
637 |
* @param p {@inheritDoc} |
|
638 |
* @return the result of {@code defaultAction} |
|
639 |
*/ |
|
640 |
@Override |
|
10 | 641 |
public R visitArrayType(ArrayTypeTree node, P p) { |
642 |
return defaultAction(node, p); |
|
643 |
} |
|
644 |
||
25287 | 645 |
/** |
646 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
647 |
* |
|
648 |
* @param node {@inheritDoc} |
|
649 |
* @param p {@inheritDoc} |
|
650 |
* @return the result of {@code defaultAction} |
|
651 |
*/ |
|
652 |
@Override |
|
10 | 653 |
public R visitParameterizedType(ParameterizedTypeTree node, P p) { |
654 |
return defaultAction(node, p); |
|
655 |
} |
|
656 |
||
25287 | 657 |
/** |
658 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
659 |
* |
|
660 |
* @param node {@inheritDoc} |
|
661 |
* @param p {@inheritDoc} |
|
662 |
* @return the result of {@code defaultAction} |
|
663 |
*/ |
|
664 |
@Override |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
665 |
public R visitUnionType(UnionTypeTree node, P p) { |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
666 |
return defaultAction(node, p); |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
667 |
} |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
668 |
|
25287 | 669 |
/** |
670 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
671 |
* |
|
672 |
* @param node {@inheritDoc} |
|
673 |
* @param p {@inheritDoc} |
|
674 |
* @return the result of {@code defaultAction} |
|
675 |
*/ |
|
676 |
@Override |
|
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
677 |
public R visitIntersectionType(IntersectionTypeTree node, P p) { |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
678 |
return defaultAction(node, p); |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
679 |
} |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
680 |
|
25287 | 681 |
/** |
682 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
683 |
* |
|
684 |
* @param node {@inheritDoc} |
|
685 |
* @param p {@inheritDoc} |
|
686 |
* @return the result of {@code defaultAction} |
|
687 |
*/ |
|
688 |
@Override |
|
10 | 689 |
public R visitTypeParameter(TypeParameterTree node, P p) { |
690 |
return defaultAction(node, p); |
|
691 |
} |
|
692 |
||
25287 | 693 |
/** |
694 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
695 |
* |
|
696 |
* @param node {@inheritDoc} |
|
697 |
* @param p {@inheritDoc} |
|
698 |
* @return the result of {@code defaultAction} |
|
699 |
*/ |
|
700 |
@Override |
|
10 | 701 |
public R visitWildcard(WildcardTree node, P p) { |
702 |
return defaultAction(node, p); |
|
703 |
} |
|
704 |
||
25287 | 705 |
/** |
706 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
707 |
* |
|
708 |
* @param node {@inheritDoc} |
|
709 |
* @param p {@inheritDoc} |
|
710 |
* @return the result of {@code defaultAction} |
|
711 |
*/ |
|
712 |
@Override |
|
10 | 713 |
public R visitModifiers(ModifiersTree node, P p) { |
714 |
return defaultAction(node, p); |
|
715 |
} |
|
716 |
||
25287 | 717 |
/** |
718 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
719 |
* |
|
720 |
* @param node {@inheritDoc} |
|
721 |
* @param p {@inheritDoc} |
|
722 |
* @return the result of {@code defaultAction} |
|
723 |
*/ |
|
724 |
@Override |
|
10 | 725 |
public R visitAnnotation(AnnotationTree node, P p) { |
726 |
return defaultAction(node, p); |
|
727 |
} |
|
728 |
||
25287 | 729 |
/** |
730 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
731 |
* |
|
732 |
* @param node {@inheritDoc} |
|
733 |
* @param p {@inheritDoc} |
|
734 |
* @return the result of {@code defaultAction} |
|
735 |
*/ |
|
736 |
@Override |
|
15385 | 737 |
public R visitAnnotatedType(AnnotatedTypeTree node, P p) { |
738 |
return defaultAction(node, p); |
|
739 |
} |
|
740 |
||
36526 | 741 |
public R visitModule(ModuleTree node, P p) { |
742 |
return defaultAction(node, p); |
|
743 |
} |
|
744 |
||
745 |
@Override |
|
746 |
public R visitExports(ExportsTree node, P p) { |
|
747 |
return defaultAction(node, p); |
|
748 |
} |
|
749 |
||
25287 | 750 |
@Override |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
751 |
public R visitOpens(OpensTree node, P p) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
752 |
return defaultAction(node, p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
753 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
754 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
755 |
@Override |
36526 | 756 |
public R visitProvides(ProvidesTree node, P p) { |
757 |
return defaultAction(node, p); |
|
758 |
} |
|
759 |
||
760 |
@Override |
|
761 |
public R visitRequires(RequiresTree node, P p) { |
|
762 |
return defaultAction(node, p); |
|
763 |
} |
|
764 |
||
765 |
@Override |
|
766 |
public R visitUses(UsesTree node, P p) { |
|
767 |
return defaultAction(node, p); |
|
768 |
} |
|
769 |
||
10 | 770 |
public R visitErroneous(ErroneousTree node, P p) { |
771 |
return defaultAction(node, p); |
|
772 |
} |
|
773 |
||
25287 | 774 |
/** |
775 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
776 |
* |
|
777 |
* @param node {@inheritDoc} |
|
778 |
* @param p {@inheritDoc} |
|
779 |
* @return the result of {@code defaultAction} |
|
780 |
*/ |
|
781 |
@Override |
|
10 | 782 |
public R visitOther(Tree node, P p) { |
783 |
return defaultAction(node, p); |
|
784 |
} |
|
55306 | 785 |
|
786 |
/** |
|
787 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
788 |
* |
|
789 |
* @param node {@inheritDoc} |
|
790 |
* @param p {@inheritDoc} |
|
791 |
* @return the result of {@code defaultAction} |
|
792 |
*/ |
|
793 |
@Override |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
794 |
@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
|
795 |
@SuppressWarnings("preview") |
55306 | 796 |
public R visitYield(YieldTree node, P p) { |
797 |
return defaultAction(node, p); |
|
798 |
} |
|
10 | 799 |
} |