author | jlahoda |
Wed, 27 Nov 2019 09:00:01 +0100 | |
changeset 59285 | 7799a51dbe30 |
parent 59021 | cfc7bb9a5a92 |
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 TreeVisitor that visits all the child tree nodes. |
|
32 |
* To visit nodes of a particular type, just override the |
|
33 |
* corresponding visitXYZ method. |
|
34 |
* Inside your method, call super.visitXYZ to visit descendant |
|
35 |
* nodes. |
|
36 |
* |
|
37 |
* <p>The default implementation of the visitXYZ methods will determine |
|
38 |
* a result as follows: |
|
39 |
* <ul> |
|
25287 | 40 |
* <li>If the node being visited has no children, the result will be {@code null}. |
10 | 41 |
* <li>If the node being visited has one child, the result will be the |
42 |
* result of calling {@code scan} on that child. The child may be a simple node |
|
43 |
* or itself a list of nodes. |
|
44 |
* <li> If the node being visited has more than one child, the result will |
|
45 |
* be determined by calling {@code scan} each child in turn, and then combining the |
|
46 |
* result of each scan after the first with the cumulative result |
|
47 |
* so far, as determined by the {@link #reduce} method. Each child may be either |
|
48 |
* a simple node of a list of nodes. The default behavior of the {@code reduce} |
|
49 |
* method is such that the result of the visitXYZ method will be the result of |
|
50 |
* the last child scanned. |
|
51 |
* </ul> |
|
52 |
* |
|
53 |
* <p>Here is an example to count the number of identifier nodes in a tree: |
|
54 |
* <pre> |
|
13844 | 55 |
* class CountIdentifiers extends TreeScanner<Integer,Void> { |
10 | 56 |
* {@literal @}Override |
57 |
* public Integer visitIdentifier(IdentifierTree node, Void p) { |
|
58 |
* return 1; |
|
59 |
* } |
|
60 |
* {@literal @}Override |
|
61 |
* public Integer reduce(Integer r1, Integer r2) { |
|
62 |
* return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2); |
|
63 |
* } |
|
64 |
* } |
|
65 |
* </pre> |
|
66 |
* |
|
25287 | 67 |
* @param <R> the return type of this visitor's methods. Use {@link |
68 |
* Void} for visitors that do not need to return results. |
|
69 |
* @param <P> the type of the additional parameter to this visitor's |
|
70 |
* methods. Use {@code Void} for visitors that do not need an |
|
71 |
* additional parameter. |
|
72 |
* |
|
10 | 73 |
* @author Peter von der Ahé |
74 |
* @author Jonathan Gibbons |
|
75 |
* @since 1.6 |
|
76 |
*/ |
|
77 |
public class TreeScanner<R,P> implements TreeVisitor<R,P> { |
|
78 |
||
25287 | 79 |
/** |
80 |
* Scans a single node. |
|
81 |
* @param tree the node to be scanned |
|
82 |
* @param p a parameter value passed to the visit method |
|
83 |
* @return the result value from the visit method |
|
10 | 84 |
*/ |
25287 | 85 |
public R scan(Tree tree, P p) { |
86 |
return (tree == null) ? null : tree.accept(this, p); |
|
10 | 87 |
} |
88 |
||
89 |
private R scanAndReduce(Tree node, P p, R r) { |
|
90 |
return reduce(scan(node, p), r); |
|
91 |
} |
|
92 |
||
25287 | 93 |
/** |
94 |
* Scans a sequence of nodes. |
|
95 |
* @param nodes the nodes to be scanned |
|
96 |
* @param p a parameter value to be passed to the visit method for each node |
|
97 |
* @return the combined return value from the visit methods. |
|
98 |
* The values are combined using the {@link #reduce reduce} method. |
|
10 | 99 |
*/ |
100 |
public R scan(Iterable<? extends Tree> nodes, P p) { |
|
101 |
R r = null; |
|
102 |
if (nodes != null) { |
|
103 |
boolean first = true; |
|
104 |
for (Tree node : nodes) { |
|
105 |
r = (first ? scan(node, p) : scanAndReduce(node, p, r)); |
|
106 |
first = false; |
|
107 |
} |
|
108 |
} |
|
109 |
return r; |
|
110 |
} |
|
111 |
||
112 |
private R scanAndReduce(Iterable<? extends Tree> nodes, P p, R r) { |
|
113 |
return reduce(scan(nodes, p), r); |
|
114 |
} |
|
115 |
||
116 |
/** |
|
117 |
* Reduces two results into a combined result. |
|
118 |
* The default implementation is to return the first parameter. |
|
119 |
* The general contract of the method is that it may take any action whatsoever. |
|
25287 | 120 |
* @param r1 the first of the values to be combined |
121 |
* @param r2 the second of the values to be combined |
|
122 |
* @return the result of combining the two parameters |
|
10 | 123 |
*/ |
124 |
public R reduce(R r1, R r2) { |
|
125 |
return r1; |
|
126 |
} |
|
127 |
||
128 |
||
129 |
/* *************************************************************************** |
|
130 |
* Visitor methods |
|
131 |
****************************************************************************/ |
|
132 |
||
25287 | 133 |
/** |
134 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
135 |
* |
|
136 |
* @param node {@inheritDoc} |
|
137 |
* @param p {@inheritDoc} |
|
138 |
* @return the result of scanning |
|
139 |
*/ |
|
140 |
@Override |
|
10 | 141 |
public R visitCompilationUnit(CompilationUnitTree node, P p) { |
24069 | 142 |
R r = scan(node.getPackage(), p); |
10 | 143 |
r = scanAndReduce(node.getImports(), p, r); |
144 |
r = scanAndReduce(node.getTypeDecls(), p, r); |
|
145 |
return r; |
|
146 |
} |
|
147 |
||
25287 | 148 |
/** |
149 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
150 |
* |
|
151 |
* @param node {@inheritDoc} |
|
152 |
* @param p {@inheritDoc} |
|
153 |
* @return the result of scanning |
|
154 |
*/ |
|
155 |
@Override |
|
24069 | 156 |
public R visitPackage(PackageTree node, P p) { |
157 |
R r = scan(node.getAnnotations(), p); |
|
158 |
r = scanAndReduce(node.getPackageName(), p, r); |
|
159 |
return r; |
|
160 |
} |
|
161 |
||
25287 | 162 |
/** |
163 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
164 |
* |
|
165 |
* @param node {@inheritDoc} |
|
166 |
* @param p {@inheritDoc} |
|
167 |
* @return the result of scanning |
|
168 |
*/ |
|
169 |
@Override |
|
10 | 170 |
public R visitImport(ImportTree node, P p) { |
171 |
return scan(node.getQualifiedIdentifier(), p); |
|
172 |
} |
|
173 |
||
25287 | 174 |
/** |
175 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
176 |
* |
|
177 |
* @param node {@inheritDoc} |
|
178 |
* @param p {@inheritDoc} |
|
179 |
* @return the result of scanning |
|
180 |
*/ |
|
181 |
@Override |
|
10 | 182 |
public R visitClass(ClassTree node, P p) { |
183 |
R r = scan(node.getModifiers(), p); |
|
184 |
r = scanAndReduce(node.getTypeParameters(), p, r); |
|
185 |
r = scanAndReduce(node.getExtendsClause(), p, r); |
|
186 |
r = scanAndReduce(node.getImplementsClause(), p, r); |
|
187 |
r = scanAndReduce(node.getMembers(), p, r); |
|
188 |
return r; |
|
189 |
} |
|
190 |
||
25287 | 191 |
/** |
192 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
193 |
* |
|
194 |
* @param node {@inheritDoc} |
|
195 |
* @param p {@inheritDoc} |
|
196 |
* @return the result of scanning |
|
197 |
*/ |
|
198 |
@Override |
|
10 | 199 |
public R visitMethod(MethodTree node, P p) { |
200 |
R r = scan(node.getModifiers(), p); |
|
201 |
r = scanAndReduce(node.getReturnType(), p, r); |
|
202 |
r = scanAndReduce(node.getTypeParameters(), p, r); |
|
203 |
r = scanAndReduce(node.getParameters(), p, r); |
|
15385 | 204 |
r = scanAndReduce(node.getReceiverParameter(), p, r); |
10 | 205 |
r = scanAndReduce(node.getThrows(), p, r); |
206 |
r = scanAndReduce(node.getBody(), p, r); |
|
6597
9367c22c445f
6983239: TreeScanner does not scan default value for method
jjg
parents:
6148
diff
changeset
|
207 |
r = scanAndReduce(node.getDefaultValue(), p, r); |
10 | 208 |
return r; |
209 |
} |
|
210 |
||
25287 | 211 |
/** |
212 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
213 |
* |
|
214 |
* @param node {@inheritDoc} |
|
215 |
* @param p {@inheritDoc} |
|
216 |
* @return the result of scanning |
|
217 |
*/ |
|
218 |
@Override |
|
10 | 219 |
public R visitVariable(VariableTree node, P p) { |
220 |
R r = scan(node.getModifiers(), p); |
|
221 |
r = scanAndReduce(node.getType(), p, r); |
|
17580 | 222 |
r = scanAndReduce(node.getNameExpression(), p, r); |
10 | 223 |
r = scanAndReduce(node.getInitializer(), p, r); |
224 |
return r; |
|
225 |
} |
|
226 |
||
25287 | 227 |
/** |
228 |
* {@inheritDoc} This implementation returns {@code null}. |
|
229 |
* |
|
230 |
* @param node {@inheritDoc} |
|
231 |
* @param p {@inheritDoc} |
|
232 |
* @return the result of scanning |
|
233 |
*/ |
|
234 |
@Override |
|
10 | 235 |
public R visitEmptyStatement(EmptyStatementTree node, P p) { |
236 |
return null; |
|
237 |
} |
|
238 |
||
25287 | 239 |
/** |
240 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
241 |
* |
|
242 |
* @param node {@inheritDoc} |
|
243 |
* @param p {@inheritDoc} |
|
244 |
* @return the result of scanning |
|
245 |
*/ |
|
246 |
@Override |
|
10 | 247 |
public R visitBlock(BlockTree node, P p) { |
248 |
return scan(node.getStatements(), p); |
|
249 |
} |
|
250 |
||
25287 | 251 |
/** |
252 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
253 |
* |
|
254 |
* @param node {@inheritDoc} |
|
255 |
* @param p {@inheritDoc} |
|
256 |
* @return the result of scanning |
|
257 |
*/ |
|
258 |
@Override |
|
10 | 259 |
public R visitDoWhileLoop(DoWhileLoopTree node, P p) { |
260 |
R r = scan(node.getStatement(), p); |
|
261 |
r = scanAndReduce(node.getCondition(), p, r); |
|
262 |
return r; |
|
263 |
} |
|
264 |
||
25287 | 265 |
/** |
266 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
267 |
* |
|
268 |
* @param node {@inheritDoc} |
|
269 |
* @param p {@inheritDoc} |
|
270 |
* @return the result of scanning |
|
271 |
*/ |
|
272 |
@Override |
|
10 | 273 |
public R visitWhileLoop(WhileLoopTree node, P p) { |
274 |
R r = scan(node.getCondition(), p); |
|
275 |
r = scanAndReduce(node.getStatement(), p, r); |
|
276 |
return r; |
|
277 |
} |
|
278 |
||
25287 | 279 |
/** |
280 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
281 |
* |
|
282 |
* @param node {@inheritDoc} |
|
283 |
* @param p {@inheritDoc} |
|
284 |
* @return the result of scanning |
|
285 |
*/ |
|
286 |
@Override |
|
10 | 287 |
public R visitForLoop(ForLoopTree node, P p) { |
288 |
R r = scan(node.getInitializer(), p); |
|
289 |
r = scanAndReduce(node.getCondition(), p, r); |
|
290 |
r = scanAndReduce(node.getUpdate(), p, r); |
|
291 |
r = scanAndReduce(node.getStatement(), p, r); |
|
292 |
return r; |
|
293 |
} |
|
294 |
||
25287 | 295 |
/** |
296 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
297 |
* |
|
298 |
* @param node {@inheritDoc} |
|
299 |
* @param p {@inheritDoc} |
|
300 |
* @return the result of scanning |
|
301 |
*/ |
|
302 |
@Override |
|
10 | 303 |
public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { |
304 |
R r = scan(node.getVariable(), p); |
|
305 |
r = scanAndReduce(node.getExpression(), p, r); |
|
306 |
r = scanAndReduce(node.getStatement(), p, r); |
|
307 |
return r; |
|
308 |
} |
|
309 |
||
25287 | 310 |
/** |
311 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
312 |
* |
|
313 |
* @param node {@inheritDoc} |
|
314 |
* @param p {@inheritDoc} |
|
315 |
* @return the result of scanning |
|
316 |
*/ |
|
317 |
@Override |
|
10 | 318 |
public R visitLabeledStatement(LabeledStatementTree node, P p) { |
319 |
return scan(node.getStatement(), p); |
|
320 |
} |
|
321 |
||
25287 | 322 |
/** |
323 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
324 |
* |
|
325 |
* @param node {@inheritDoc} |
|
326 |
* @param p {@inheritDoc} |
|
327 |
* @return the result of scanning |
|
328 |
*/ |
|
329 |
@Override |
|
10 | 330 |
public R visitSwitch(SwitchTree node, P p) { |
331 |
R r = scan(node.getExpression(), p); |
|
332 |
r = scanAndReduce(node.getCases(), p, r); |
|
333 |
return r; |
|
334 |
} |
|
335 |
||
25287 | 336 |
/** |
337 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
338 |
* |
|
339 |
* @param node {@inheritDoc} |
|
340 |
* @param p {@inheritDoc} |
|
341 |
* @return the result of scanning |
|
342 |
*/ |
|
343 |
@Override |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
344 |
public R visitSwitchExpression(SwitchExpressionTree node, P p) { |
10 | 345 |
R r = scan(node.getExpression(), p); |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
346 |
r = scanAndReduce(node.getCases(), p, r); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
347 |
return r; |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
348 |
} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
349 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
350 |
/** |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
351 |
* {@inheritDoc} This implementation scans the children in left to right order. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
352 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
353 |
* @param node {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
354 |
* @param p {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
355 |
* @return the result of scanning |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
356 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
357 |
@Override |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
358 |
public R visitCase(CaseTree node, P p) { |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
359 |
R r = scan(node.getExpressions(), p); |
58713
ad69fd32778e
8226585: Improve javac messages for using a preview API
jlahoda
parents:
55306
diff
changeset
|
360 |
if (node.getCaseKind() == CaseTree.CaseKind.RULE) |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
361 |
r = scanAndReduce(node.getBody(), p, r); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
362 |
else |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
363 |
r = scanAndReduce(node.getStatements(), p, r); |
10 | 364 |
return r; |
365 |
} |
|
366 |
||
25287 | 367 |
/** |
368 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
369 |
* |
|
370 |
* @param node {@inheritDoc} |
|
371 |
* @param p {@inheritDoc} |
|
372 |
* @return the result of scanning |
|
373 |
*/ |
|
374 |
@Override |
|
10 | 375 |
public R visitSynchronized(SynchronizedTree node, P p) { |
376 |
R r = scan(node.getExpression(), p); |
|
377 |
r = scanAndReduce(node.getBlock(), p, r); |
|
378 |
return r; |
|
379 |
} |
|
380 |
||
25287 | 381 |
/** |
382 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
383 |
* |
|
384 |
* @param node {@inheritDoc} |
|
385 |
* @param p {@inheritDoc} |
|
386 |
* @return the result of scanning |
|
387 |
*/ |
|
388 |
@Override |
|
10 | 389 |
public R visitTry(TryTree node, P p) { |
6148
3a8158299c51
6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents:
5520
diff
changeset
|
390 |
R r = scan(node.getResources(), p); |
3a8158299c51
6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents:
5520
diff
changeset
|
391 |
r = scanAndReduce(node.getBlock(), p, r); |
10 | 392 |
r = scanAndReduce(node.getCatches(), p, r); |
393 |
r = scanAndReduce(node.getFinallyBlock(), p, r); |
|
394 |
return r; |
|
395 |
} |
|
396 |
||
25287 | 397 |
/** |
398 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
399 |
* |
|
400 |
* @param node {@inheritDoc} |
|
401 |
* @param p {@inheritDoc} |
|
402 |
* @return the result of scanning |
|
403 |
*/ |
|
404 |
@Override |
|
10 | 405 |
public R visitCatch(CatchTree node, P p) { |
406 |
R r = scan(node.getParameter(), p); |
|
407 |
r = scanAndReduce(node.getBlock(), p, r); |
|
408 |
return r; |
|
409 |
} |
|
410 |
||
25287 | 411 |
/** |
412 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
413 |
* |
|
414 |
* @param node {@inheritDoc} |
|
415 |
* @param p {@inheritDoc} |
|
416 |
* @return the result of scanning |
|
417 |
*/ |
|
418 |
@Override |
|
10 | 419 |
public R visitConditionalExpression(ConditionalExpressionTree node, P p) { |
420 |
R r = scan(node.getCondition(), p); |
|
421 |
r = scanAndReduce(node.getTrueExpression(), p, r); |
|
422 |
r = scanAndReduce(node.getFalseExpression(), p, r); |
|
423 |
return r; |
|
424 |
} |
|
425 |
||
25287 | 426 |
/** |
427 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
428 |
* |
|
429 |
* @param node {@inheritDoc} |
|
430 |
* @param p {@inheritDoc} |
|
431 |
* @return the result of scanning |
|
432 |
*/ |
|
433 |
@Override |
|
10 | 434 |
public R visitIf(IfTree node, P p) { |
435 |
R r = scan(node.getCondition(), p); |
|
436 |
r = scanAndReduce(node.getThenStatement(), p, r); |
|
437 |
r = scanAndReduce(node.getElseStatement(), p, r); |
|
438 |
return r; |
|
439 |
} |
|
440 |
||
25287 | 441 |
/** |
442 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
443 |
* |
|
444 |
* @param node {@inheritDoc} |
|
445 |
* @param p {@inheritDoc} |
|
446 |
* @return the result of scanning |
|
447 |
*/ |
|
448 |
@Override |
|
10 | 449 |
public R visitExpressionStatement(ExpressionStatementTree node, P p) { |
450 |
return scan(node.getExpression(), p); |
|
451 |
} |
|
452 |
||
25287 | 453 |
/** |
454 |
* {@inheritDoc} This implementation returns {@code null}. |
|
455 |
* |
|
456 |
* @param node {@inheritDoc} |
|
457 |
* @param p {@inheritDoc} |
|
458 |
* @return the result of scanning |
|
459 |
*/ |
|
460 |
@Override |
|
10 | 461 |
public R visitBreak(BreakTree node, P p) { |
55306 | 462 |
return null; |
10 | 463 |
} |
464 |
||
25287 | 465 |
/** |
466 |
* {@inheritDoc} This implementation returns {@code null}. |
|
467 |
* |
|
468 |
* @param node {@inheritDoc} |
|
469 |
* @param p {@inheritDoc} |
|
470 |
* @return the result of scanning |
|
471 |
*/ |
|
472 |
@Override |
|
10 | 473 |
public R visitContinue(ContinueTree node, P p) { |
474 |
return null; |
|
475 |
} |
|
476 |
||
25287 | 477 |
/** |
478 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
479 |
* |
|
480 |
* @param node {@inheritDoc} |
|
481 |
* @param p {@inheritDoc} |
|
482 |
* @return the result of scanning |
|
483 |
*/ |
|
484 |
@Override |
|
10 | 485 |
public R visitReturn(ReturnTree node, P p) { |
486 |
return scan(node.getExpression(), p); |
|
487 |
} |
|
488 |
||
25287 | 489 |
/** |
490 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
491 |
* |
|
492 |
* @param node {@inheritDoc} |
|
493 |
* @param p {@inheritDoc} |
|
494 |
* @return the result of scanning |
|
495 |
*/ |
|
496 |
@Override |
|
10 | 497 |
public R visitThrow(ThrowTree node, P p) { |
498 |
return scan(node.getExpression(), p); |
|
499 |
} |
|
500 |
||
25287 | 501 |
/** |
502 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
503 |
* |
|
504 |
* @param node {@inheritDoc} |
|
505 |
* @param p {@inheritDoc} |
|
506 |
* @return the result of scanning |
|
507 |
*/ |
|
508 |
@Override |
|
10 | 509 |
public R visitAssert(AssertTree node, P p) { |
510 |
R r = scan(node.getCondition(), p); |
|
511 |
r = scanAndReduce(node.getDetail(), p, r); |
|
512 |
return r; |
|
513 |
} |
|
514 |
||
25287 | 515 |
/** |
516 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
517 |
* |
|
518 |
* @param node {@inheritDoc} |
|
519 |
* @param p {@inheritDoc} |
|
520 |
* @return the result of scanning |
|
521 |
*/ |
|
522 |
@Override |
|
10 | 523 |
public R visitMethodInvocation(MethodInvocationTree node, P p) { |
524 |
R r = scan(node.getTypeArguments(), p); |
|
525 |
r = scanAndReduce(node.getMethodSelect(), p, r); |
|
526 |
r = scanAndReduce(node.getArguments(), p, r); |
|
527 |
return r; |
|
528 |
} |
|
529 |
||
25287 | 530 |
/** |
531 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
532 |
* |
|
533 |
* @param node {@inheritDoc} |
|
534 |
* @param p {@inheritDoc} |
|
535 |
* @return the result of scanning |
|
536 |
*/ |
|
537 |
@Override |
|
10 | 538 |
public R visitNewClass(NewClassTree node, P p) { |
539 |
R r = scan(node.getEnclosingExpression(), p); |
|
540 |
r = scanAndReduce(node.getIdentifier(), p, r); |
|
541 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
542 |
r = scanAndReduce(node.getArguments(), p, r); |
|
543 |
r = scanAndReduce(node.getClassBody(), p, r); |
|
544 |
return r; |
|
545 |
} |
|
546 |
||
25287 | 547 |
/** |
548 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
549 |
* |
|
550 |
* @param node {@inheritDoc} |
|
551 |
* @param p {@inheritDoc} |
|
552 |
* @return the result of scanning |
|
553 |
*/ |
|
554 |
@Override |
|
10 | 555 |
public R visitNewArray(NewArrayTree node, P p) { |
556 |
R r = scan(node.getType(), p); |
|
557 |
r = scanAndReduce(node.getDimensions(), p, r); |
|
558 |
r = scanAndReduce(node.getInitializers(), p, r); |
|
19491 | 559 |
r = scanAndReduce(node.getAnnotations(), p, r); |
560 |
for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) { |
|
561 |
r = scanAndReduce(dimAnno, p, r); |
|
562 |
} |
|
10 | 563 |
return r; |
564 |
} |
|
565 |
||
25287 | 566 |
/** |
567 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
568 |
* |
|
569 |
* @param node {@inheritDoc} |
|
570 |
* @param p {@inheritDoc} |
|
571 |
* @return the result of scanning |
|
572 |
*/ |
|
573 |
@Override |
|
11141 | 574 |
public R visitLambdaExpression(LambdaExpressionTree node, P p) { |
575 |
R r = scan(node.getParameters(), p); |
|
576 |
r = scanAndReduce(node.getBody(), p, r); |
|
577 |
return r; |
|
578 |
} |
|
579 |
||
25287 | 580 |
/** |
581 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
582 |
* |
|
583 |
* @param node {@inheritDoc} |
|
584 |
* @param p {@inheritDoc} |
|
585 |
* @return the result of scanning |
|
586 |
*/ |
|
587 |
@Override |
|
10 | 588 |
public R visitParenthesized(ParenthesizedTree node, P p) { |
589 |
return scan(node.getExpression(), p); |
|
590 |
} |
|
591 |
||
25287 | 592 |
/** |
593 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
594 |
* |
|
595 |
* @param node {@inheritDoc} |
|
596 |
* @param p {@inheritDoc} |
|
597 |
* @return the result of scanning |
|
598 |
*/ |
|
599 |
@Override |
|
10 | 600 |
public R visitAssignment(AssignmentTree node, P p) { |
601 |
R r = scan(node.getVariable(), p); |
|
602 |
r = scanAndReduce(node.getExpression(), p, r); |
|
603 |
return r; |
|
604 |
} |
|
605 |
||
25287 | 606 |
/** |
607 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
608 |
* |
|
609 |
* @param node {@inheritDoc} |
|
610 |
* @param p {@inheritDoc} |
|
611 |
* @return the result of scanning |
|
612 |
*/ |
|
613 |
@Override |
|
10 | 614 |
public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { |
615 |
R r = scan(node.getVariable(), p); |
|
616 |
r = scanAndReduce(node.getExpression(), p, r); |
|
617 |
return r; |
|
618 |
} |
|
619 |
||
25287 | 620 |
/** |
621 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
622 |
* |
|
623 |
* @param node {@inheritDoc} |
|
624 |
* @param p {@inheritDoc} |
|
625 |
* @return the result of scanning |
|
626 |
*/ |
|
627 |
@Override |
|
10 | 628 |
public R visitUnary(UnaryTree node, P p) { |
629 |
return scan(node.getExpression(), p); |
|
630 |
} |
|
631 |
||
25287 | 632 |
/** |
633 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
634 |
* |
|
635 |
* @param node {@inheritDoc} |
|
636 |
* @param p {@inheritDoc} |
|
637 |
* @return the result of scanning |
|
638 |
*/ |
|
639 |
@Override |
|
10 | 640 |
public R visitBinary(BinaryTree node, P p) { |
641 |
R r = scan(node.getLeftOperand(), p); |
|
642 |
r = scanAndReduce(node.getRightOperand(), p, r); |
|
643 |
return r; |
|
644 |
} |
|
645 |
||
25287 | 646 |
/** |
647 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
648 |
* |
|
649 |
* @param node {@inheritDoc} |
|
650 |
* @param p {@inheritDoc} |
|
651 |
* @return the result of scanning |
|
652 |
*/ |
|
653 |
@Override |
|
10 | 654 |
public R visitTypeCast(TypeCastTree node, P p) { |
655 |
R r = scan(node.getType(), p); |
|
656 |
r = scanAndReduce(node.getExpression(), p, r); |
|
657 |
return r; |
|
658 |
} |
|
659 |
||
25287 | 660 |
/** |
661 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
662 |
* |
|
663 |
* @param node {@inheritDoc} |
|
664 |
* @param p {@inheritDoc} |
|
665 |
* @return the result of scanning |
|
666 |
*/ |
|
667 |
@Override |
|
10 | 668 |
public R visitInstanceOf(InstanceOfTree node, P p) { |
669 |
R r = scan(node.getExpression(), p); |
|
59285
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
670 |
if (node.getPattern() != null) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
671 |
r = scanAndReduce(node.getPattern(), p, r); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
672 |
} else { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
673 |
r = scanAndReduce(node.getType(), p, r); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
674 |
} |
10 | 675 |
return r; |
676 |
} |
|
677 |
||
25287 | 678 |
/** |
679 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
680 |
* |
|
681 |
* @param node {@inheritDoc} |
|
682 |
* @param p {@inheritDoc} |
|
683 |
* @return the result of scanning |
|
59285
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
684 |
* @since 14 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
685 |
*/ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
686 |
@Override |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
687 |
public R visitBindingPattern(BindingPatternTree node, P p) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
688 |
return scan(node.getType(), p); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
689 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
690 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
691 |
/** |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
692 |
* {@inheritDoc} This implementation scans the children in left to right order. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
693 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
694 |
* @param node {@inheritDoc} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
695 |
* @param p {@inheritDoc} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
696 |
* @return the result of scanning |
25287 | 697 |
*/ |
698 |
@Override |
|
10 | 699 |
public R visitArrayAccess(ArrayAccessTree node, P p) { |
700 |
R r = scan(node.getExpression(), p); |
|
701 |
r = scanAndReduce(node.getIndex(), p, r); |
|
702 |
return r; |
|
703 |
} |
|
704 |
||
25287 | 705 |
/** |
706 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
707 |
* |
|
708 |
* @param node {@inheritDoc} |
|
709 |
* @param p {@inheritDoc} |
|
710 |
* @return the result of scanning |
|
711 |
*/ |
|
712 |
@Override |
|
10 | 713 |
public R visitMemberSelect(MemberSelectTree node, P p) { |
714 |
return scan(node.getExpression(), p); |
|
715 |
} |
|
716 |
||
25287 | 717 |
/** |
718 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
719 |
* |
|
720 |
* @param node {@inheritDoc} |
|
721 |
* @param p {@inheritDoc} |
|
722 |
* @return the result of scanning |
|
723 |
*/ |
|
724 |
@Override |
|
11142 | 725 |
public R visitMemberReference(MemberReferenceTree node, P p) { |
726 |
R r = scan(node.getQualifierExpression(), p); |
|
727 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
728 |
return r; |
|
729 |
} |
|
730 |
||
25287 | 731 |
/** |
732 |
* {@inheritDoc} This implementation returns {@code null}. |
|
733 |
* |
|
734 |
* @param node {@inheritDoc} |
|
735 |
* @param p {@inheritDoc} |
|
736 |
* @return the result of scanning |
|
737 |
*/ |
|
738 |
@Override |
|
10 | 739 |
public R visitIdentifier(IdentifierTree node, P p) { |
740 |
return null; |
|
741 |
} |
|
742 |
||
25287 | 743 |
/** |
744 |
* {@inheritDoc} This implementation returns {@code null}. |
|
745 |
* |
|
746 |
* @param node {@inheritDoc} |
|
747 |
* @param p {@inheritDoc} |
|
748 |
* @return the result of scanning |
|
749 |
*/ |
|
750 |
@Override |
|
10 | 751 |
public R visitLiteral(LiteralTree node, P p) { |
752 |
return null; |
|
753 |
} |
|
754 |
||
25287 | 755 |
/** |
756 |
* {@inheritDoc} This implementation returns {@code null}. |
|
757 |
* |
|
758 |
* @param node {@inheritDoc} |
|
759 |
* @param p {@inheritDoc} |
|
760 |
* @return the result of scanning |
|
761 |
*/ |
|
762 |
@Override |
|
10 | 763 |
public R visitPrimitiveType(PrimitiveTypeTree node, P p) { |
764 |
return null; |
|
765 |
} |
|
766 |
||
25287 | 767 |
/** |
768 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
769 |
* |
|
770 |
* @param node {@inheritDoc} |
|
771 |
* @param p {@inheritDoc} |
|
772 |
* @return the result of scanning |
|
773 |
*/ |
|
774 |
@Override |
|
10 | 775 |
public R visitArrayType(ArrayTypeTree node, P p) { |
776 |
return scan(node.getType(), p); |
|
777 |
} |
|
778 |
||
25287 | 779 |
/** |
780 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
781 |
* |
|
782 |
* @param node {@inheritDoc} |
|
783 |
* @param p {@inheritDoc} |
|
784 |
* @return the result of scanning |
|
785 |
*/ |
|
786 |
@Override |
|
10 | 787 |
public R visitParameterizedType(ParameterizedTypeTree node, P p) { |
788 |
R r = scan(node.getType(), p); |
|
789 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
790 |
return r; |
|
791 |
} |
|
792 |
||
25287 | 793 |
/** |
794 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
795 |
* |
|
796 |
* @param node {@inheritDoc} |
|
797 |
* @param p {@inheritDoc} |
|
798 |
* @return the result of scanning |
|
799 |
*/ |
|
800 |
@Override |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
801 |
public R visitUnionType(UnionTypeTree node, P p) { |
7074 | 802 |
return scan(node.getTypeAlternatives(), p); |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
803 |
} |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
804 |
|
25287 | 805 |
/** |
806 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
807 |
* |
|
808 |
* @param node {@inheritDoc} |
|
809 |
* @param p {@inheritDoc} |
|
810 |
* @return the result of scanning |
|
811 |
*/ |
|
812 |
@Override |
|
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
813 |
public R visitIntersectionType(IntersectionTypeTree node, P p) { |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
814 |
return scan(node.getBounds(), p); |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
815 |
} |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
816 |
|
25287 | 817 |
/** |
818 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
819 |
* |
|
820 |
* @param node {@inheritDoc} |
|
821 |
* @param p {@inheritDoc} |
|
822 |
* @return the result of scanning |
|
823 |
*/ |
|
824 |
@Override |
|
10 | 825 |
public R visitTypeParameter(TypeParameterTree node, P p) { |
15385 | 826 |
R r = scan(node.getAnnotations(), p); |
827 |
r = scanAndReduce(node.getBounds(), p, r); |
|
3149 | 828 |
return r; |
10 | 829 |
} |
830 |
||
25287 | 831 |
/** |
832 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
833 |
* |
|
834 |
* @param node {@inheritDoc} |
|
835 |
* @param p {@inheritDoc} |
|
836 |
* @return the result of scanning |
|
837 |
*/ |
|
838 |
@Override |
|
10 | 839 |
public R visitWildcard(WildcardTree node, P p) { |
840 |
return scan(node.getBound(), p); |
|
841 |
} |
|
842 |
||
25287 | 843 |
/** |
844 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
845 |
* |
|
846 |
* @param node {@inheritDoc} |
|
847 |
* @param p {@inheritDoc} |
|
848 |
* @return the result of scanning |
|
849 |
*/ |
|
850 |
@Override |
|
10 | 851 |
public R visitModifiers(ModifiersTree node, P p) { |
852 |
return scan(node.getAnnotations(), p); |
|
853 |
} |
|
854 |
||
25287 | 855 |
/** |
856 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
857 |
* |
|
858 |
* @param node {@inheritDoc} |
|
859 |
* @param p {@inheritDoc} |
|
860 |
* @return the result of scanning |
|
861 |
*/ |
|
862 |
@Override |
|
10 | 863 |
public R visitAnnotation(AnnotationTree node, P p) { |
864 |
R r = scan(node.getAnnotationType(), p); |
|
865 |
r = scanAndReduce(node.getArguments(), p, r); |
|
866 |
return r; |
|
867 |
} |
|
868 |
||
25287 | 869 |
/** |
870 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
871 |
* |
|
872 |
* @param node {@inheritDoc} |
|
873 |
* @param p {@inheritDoc} |
|
874 |
* @return the result of scanning |
|
875 |
*/ |
|
876 |
@Override |
|
877 |
public R visitAnnotatedType(AnnotatedTypeTree node, P p) { |
|
878 |
R r = scan(node.getAnnotations(), p); |
|
879 |
r = scanAndReduce(node.getUnderlyingType(), p, r); |
|
880 |
return r; |
|
881 |
} |
|
15385 | 882 |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
883 |
@Override |
36526 | 884 |
public R visitModule(ModuleTree node, P p) { |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
885 |
R r = scan(node.getAnnotations(), p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
886 |
r = scanAndReduce(node.getName(), p, r); |
36526 | 887 |
r = scanAndReduce(node.getDirectives(), p, r); |
888 |
return r; |
|
889 |
} |
|
890 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
891 |
@Override |
36526 | 892 |
public R visitExports(ExportsTree node, P p) { |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
893 |
R r = scan(node.getPackageName(), p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
894 |
r = scanAndReduce(node.getModuleNames(), p, r); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
895 |
return r; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
896 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
897 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
898 |
@Override |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
899 |
public R visitOpens(OpensTree node, P p) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
900 |
R r = scan(node.getPackageName(), p); |
36526 | 901 |
r = scanAndReduce(node.getModuleNames(), p, r); |
902 |
return r; |
|
903 |
} |
|
904 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
905 |
@Override |
36526 | 906 |
public R visitProvides(ProvidesTree node, P p) { |
907 |
R r = scan(node.getServiceName(), p); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
908 |
r = scanAndReduce(node.getImplementationNames(), p, r); |
36526 | 909 |
return r; |
910 |
} |
|
911 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
912 |
@Override |
36526 | 913 |
public R visitRequires(RequiresTree node, P p) { |
914 |
return scan(node.getModuleName(), p); |
|
915 |
} |
|
916 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
917 |
@Override |
36526 | 918 |
public R visitUses(UsesTree node, P p) { |
919 |
return scan(node.getServiceName(), p); |
|
920 |
} |
|
921 |
||
25287 | 922 |
/** |
923 |
* {@inheritDoc} This implementation returns {@code null}. |
|
924 |
* |
|
925 |
* @param node {@inheritDoc} |
|
926 |
* @param p {@inheritDoc} |
|
927 |
* @return the result of scanning |
|
928 |
*/ |
|
929 |
@Override |
|
10 | 930 |
public R visitOther(Tree node, P p) { |
931 |
return null; |
|
932 |
} |
|
933 |
||
25287 | 934 |
/** |
935 |
* {@inheritDoc} This implementation returns {@code null}. |
|
936 |
* |
|
937 |
* @param node {@inheritDoc} |
|
938 |
* @param p {@inheritDoc} |
|
939 |
* @return the result of scanning |
|
940 |
*/ |
|
941 |
@Override |
|
10 | 942 |
public R visitErroneous(ErroneousTree node, P p) { |
943 |
return null; |
|
944 |
} |
|
55306 | 945 |
|
946 |
/** |
|
947 |
* {@inheritDoc} This implementation returns {@code null}. |
|
948 |
* |
|
949 |
* @param node {@inheritDoc} |
|
950 |
* @param p {@inheritDoc} |
|
951 |
* @return the result of scanning |
|
952 |
*/ |
|
953 |
@Override |
|
954 |
public R visitYield(YieldTree node, P p) { |
|
955 |
return scan(node.getValue(), p); |
|
956 |
} |
|
10 | 957 |
} |