author | sundar |
Tue, 12 Jul 2016 21:18:13 +0530 | |
changeset 39662 | e2b36a3779b9 |
parent 35325 | 7624a7d7e661 |
child 44869 | 4d9e8c84bbda |
permissions | -rw-r--r-- |
29407 | 1 |
/* |
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
29407 | 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 |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
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 |
* |
|
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. |
|
24 |
*/ |
|
25 |
||
26 |
package jdk.nashorn.api.tree; |
|
27 |
||
28 |
/** |
|
29 |
* A visitor of trees, in the style of the visitor design pattern. |
|
30 |
* Classes implementing this interface are used to operate |
|
31 |
* on a tree when the kind of tree is unknown at compile time. |
|
32 |
* When a visitor is passed to an tree's {@link Tree#accept |
|
33 |
* accept} method, the <tt>visit<i>XYZ</i></tt> method most applicable |
|
34 |
* to that tree is invoked. |
|
35 |
* |
|
36 |
* <p> Classes implementing this interface may or may not throw a |
|
37 |
* {@code NullPointerException} if the additional parameter {@code p} |
|
38 |
* is {@code null}; see documentation of the implementing class for |
|
39 |
* details. |
|
40 |
* |
|
41 |
* <p> <b>WARNING:</b> It is possible that methods will be added to |
|
42 |
this interface to accommodate new, currently unknown, language |
|
43 |
structures added to future versions of the ECMAScript programming |
|
44 |
language. When new visit methods are added for new Tree subtypes, |
|
45 |
default method bodies will be introduced which will call visitUnknown |
|
46 |
method as a fallback. |
|
47 |
* |
|
48 |
* @param <R> the return type of this visitor's methods. Use {@link |
|
49 |
* Void} for visitors that do not need to return results. |
|
50 |
* @param <P> the type of the additional parameter to this visitor's |
|
51 |
* methods. Use {@code Void} for visitors that do not need an |
|
52 |
* additional parameter. |
|
53 |
* |
|
35325
7624a7d7e661
8136494: Update "@since 1.9" to "@since 9" to match java.version.specification
iris
parents:
34903
diff
changeset
|
54 |
* @since 9 |
29407 | 55 |
*/ |
56 |
public interface TreeVisitor<R,P> { |
|
57 |
/** |
|
58 |
* Visit assignment tree. |
|
59 |
* |
|
60 |
* @param node node being visited |
|
61 |
* @param p extra parameter passed to the visitor |
|
62 |
* @return value from the visitor |
|
63 |
*/ |
|
64 |
R visitAssignment(AssignmentTree node, P p); |
|
65 |
||
66 |
/** |
|
67 |
* Visit compound assignment tree. |
|
68 |
* |
|
69 |
* @param node node being visited |
|
70 |
* @param p extra parameter passed to the visitor |
|
71 |
* @return value from the visitor |
|
72 |
*/ |
|
73 |
R visitCompoundAssignment(CompoundAssignmentTree node, P p); |
|
74 |
||
75 |
/** |
|
76 |
* Visit binary expression tree. |
|
77 |
* |
|
78 |
* @param node node being visited |
|
79 |
* @param p extra parameter passed to the visitor |
|
80 |
* @return value from the visitor |
|
81 |
*/ |
|
82 |
R visitBinary(BinaryTree node, P p); |
|
83 |
||
84 |
/** |
|
85 |
* Visit block statement tree. |
|
86 |
* |
|
87 |
* @param node node being visited |
|
88 |
* @param p extra parameter passed to the visitor |
|
89 |
* @return value from the visitor |
|
90 |
*/ |
|
91 |
R visitBlock(BlockTree node, P p); |
|
92 |
||
93 |
/** |
|
94 |
* Visit break statement tree. |
|
95 |
* |
|
96 |
* @param node node being visited |
|
97 |
* @param p extra parameter passed to the visitor |
|
98 |
* @return value from the visitor |
|
99 |
*/ |
|
100 |
R visitBreak(BreakTree node, P p); |
|
101 |
||
102 |
/** |
|
103 |
* Visit case statement tree. |
|
104 |
* |
|
105 |
* @param node node being visited |
|
106 |
* @param p extra parameter passed to the visitor |
|
107 |
* @return value from the visitor |
|
108 |
*/ |
|
109 |
R visitCase(CaseTree node, P p); |
|
110 |
||
111 |
/** |
|
112 |
* Visit catch block statement tree. |
|
113 |
* |
|
114 |
* @param node node being visited |
|
115 |
* @param p extra parameter passed to the visitor |
|
116 |
* @return value from the visitor |
|
117 |
*/ |
|
118 |
R visitCatch(CatchTree node, P p); |
|
119 |
||
120 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
121 |
* Visit class statement tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
122 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
123 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
124 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
125 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
126 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
127 |
R visitClassDeclaration(ClassDeclarationTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
128 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
129 |
/** |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
130 |
* Visit class expression tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
131 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
132 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
133 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
134 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
135 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
136 |
R visitClassExpression(ClassExpressionTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
137 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
138 |
/** |
29407 | 139 |
* Visit conditional expression tree. |
140 |
* |
|
141 |
* @param node node being visited |
|
142 |
* @param p extra parameter passed to the visitor |
|
143 |
* @return value from the visitor |
|
144 |
*/ |
|
145 |
R visitConditionalExpression(ConditionalExpressionTree node, P p); |
|
146 |
||
147 |
/** |
|
148 |
* Visit continue statement tree. |
|
149 |
* |
|
150 |
* @param node node being visited |
|
151 |
* @param p extra parameter passed to the visitor |
|
152 |
* @return value from the visitor |
|
153 |
*/ |
|
154 |
R visitContinue(ContinueTree node, P p); |
|
155 |
||
156 |
/** |
|
157 |
* Visit debugger statement tree. |
|
158 |
* |
|
159 |
* @param node node being visited |
|
160 |
* @param p extra parameter passed to the visitor |
|
161 |
* @return value from the visitor |
|
162 |
*/ |
|
163 |
R visitDebugger(DebuggerTree node, P p); |
|
164 |
||
165 |
/** |
|
166 |
* Visit do-while statement tree. |
|
167 |
* |
|
168 |
* @param node node being visited |
|
169 |
* @param p extra parameter passed to the visitor |
|
170 |
* @return value from the visitor |
|
171 |
*/ |
|
172 |
R visitDoWhileLoop(DoWhileLoopTree node, P p); |
|
173 |
||
174 |
/** |
|
175 |
* Visit error expression tree. |
|
176 |
* |
|
177 |
* @param node node being visited |
|
178 |
* @param p extra parameter passed to the visitor |
|
179 |
* @return value from the visitor |
|
180 |
*/ |
|
181 |
R visitErroneous(ErroneousTree node, P p); |
|
182 |
||
183 |
/** |
|
184 |
* Visit expression statement tree. |
|
185 |
* |
|
186 |
* @param node node being visited |
|
187 |
* @param p extra parameter passed to the visitor |
|
188 |
* @return value from the visitor |
|
189 |
*/ |
|
190 |
R visitExpressionStatement(ExpressionStatementTree node, P p); |
|
191 |
||
192 |
/** |
|
193 |
* Visit 'for' statement tree. |
|
194 |
* |
|
195 |
* @param node node being visited |
|
196 |
* @param p extra parameter passed to the visitor |
|
197 |
* @return value from the visitor |
|
198 |
*/ |
|
199 |
R visitForLoop(ForLoopTree node, P p); |
|
200 |
||
201 |
/** |
|
202 |
* Visit for..in statement tree. |
|
203 |
* |
|
204 |
* @param node node being visited |
|
205 |
* @param p extra parameter passed to the visitor |
|
206 |
* @return value from the visitor |
|
207 |
*/ |
|
208 |
R visitForInLoop(ForInLoopTree node, P p); |
|
209 |
||
210 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
211 |
* Visit for..of statement tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
212 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
213 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
214 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
215 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
216 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
217 |
R visitForOfLoop(ForOfLoopTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
218 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
219 |
/** |
29407 | 220 |
* Visit function call expression tree. |
221 |
* |
|
222 |
* @param node node being visited |
|
223 |
* @param p extra parameter passed to the visitor |
|
224 |
* @return value from the visitor |
|
225 |
*/ |
|
226 |
R visitFunctionCall(FunctionCallTree node, P p); |
|
227 |
||
228 |
/** |
|
229 |
* Visit function declaration tree. |
|
230 |
* |
|
231 |
* @param node node being visited |
|
232 |
* @param p extra parameter passed to the visitor |
|
233 |
* @return value from the visitor |
|
234 |
*/ |
|
235 |
R visitFunctionDeclaration(FunctionDeclarationTree node, P p); |
|
236 |
||
237 |
/** |
|
238 |
* Visit function expression tree. |
|
239 |
* |
|
240 |
* @param node node being visited |
|
241 |
* @param p extra parameter passed to the visitor |
|
242 |
* @return value from the visitor |
|
243 |
*/ |
|
244 |
R visitFunctionExpression(FunctionExpressionTree node, P p); |
|
245 |
||
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
246 |
/** |
29407 | 247 |
* Visit identifier tree. |
248 |
* |
|
249 |
* @param node node being visited |
|
250 |
* @param p extra parameter passed to the visitor |
|
251 |
* @return value from the visitor |
|
252 |
*/ |
|
253 |
R visitIdentifier(IdentifierTree node, P p); |
|
254 |
||
255 |
/** |
|
256 |
* Visit 'if' statement tree. |
|
257 |
* |
|
258 |
* @param node node being visited |
|
259 |
* @param p extra parameter passed to the visitor |
|
260 |
* @return value from the visitor |
|
261 |
*/ |
|
262 |
R visitIf(IfTree node, P p); |
|
263 |
||
264 |
/** |
|
265 |
* Visit array access expression tree. |
|
266 |
* |
|
267 |
* @param node node being visited |
|
268 |
* @param p extra parameter passed to the visitor |
|
269 |
* @return value from the visitor |
|
270 |
*/ |
|
271 |
R visitArrayAccess(ArrayAccessTree node, P p); |
|
272 |
||
273 |
/** |
|
274 |
* Visit array literal expression tree. |
|
275 |
* |
|
276 |
* @param node node being visited |
|
277 |
* @param p extra parameter passed to the visitor |
|
278 |
* @return value from the visitor |
|
279 |
*/ |
|
280 |
R visitArrayLiteral(ArrayLiteralTree node, P p); |
|
281 |
||
282 |
/** |
|
283 |
* Visit labeled statement tree. |
|
284 |
* |
|
285 |
* @param node node being visited |
|
286 |
* @param p extra parameter passed to the visitor |
|
287 |
* @return value from the visitor |
|
288 |
*/ |
|
289 |
R visitLabeledStatement(LabeledStatementTree node, P p); |
|
290 |
||
291 |
/** |
|
292 |
* Visit literal expression tree. |
|
293 |
* |
|
294 |
* @param node node being visited |
|
295 |
* @param p extra parameter passed to the visitor |
|
296 |
* @return value from the visitor |
|
297 |
*/ |
|
298 |
R visitLiteral(LiteralTree node, P p); |
|
299 |
||
300 |
/** |
|
301 |
* Visit parenthesized expression tree. |
|
302 |
* |
|
303 |
* @param node node being visited |
|
304 |
* @param p extra parameter passed to the visitor |
|
305 |
* @return value from the visitor |
|
306 |
*/ |
|
307 |
R visitParenthesized(ParenthesizedTree node, P p); |
|
308 |
||
309 |
/** |
|
310 |
* Visit return statement tree. |
|
311 |
* |
|
312 |
* @param node node being visited |
|
313 |
* @param p extra parameter passed to the visitor |
|
314 |
* @return value from the visitor |
|
315 |
*/ |
|
316 |
R visitReturn(ReturnTree node, P p); |
|
317 |
||
318 |
/** |
|
319 |
* Visit member select expression tree. |
|
320 |
* |
|
321 |
* @param node node being visited |
|
322 |
* @param p extra parameter passed to the visitor |
|
323 |
* @return value from the visitor |
|
324 |
*/ |
|
325 |
R visitMemberSelect(MemberSelectTree node, P p); |
|
326 |
||
327 |
/** |
|
328 |
* Visit 'new' expression tree. |
|
329 |
* |
|
330 |
* @param node node being visited |
|
331 |
* @param p extra parameter passed to the visitor |
|
332 |
* @return value from the visitor |
|
333 |
*/ |
|
334 |
R visitNew(NewTree node, P p); |
|
335 |
||
336 |
/** |
|
337 |
* Visit object literal tree. |
|
338 |
* |
|
339 |
* @param node node being visited |
|
340 |
* @param p extra parameter passed to the visitor |
|
341 |
* @return value from the visitor |
|
342 |
*/ |
|
343 |
R visitObjectLiteral(ObjectLiteralTree node, P p); |
|
344 |
||
345 |
/** |
|
346 |
* Visit a property of an object literal expression tree. |
|
347 |
* |
|
348 |
* @param node node being visited |
|
349 |
* @param p extra parameter passed to the visitor |
|
350 |
* @return value from the visitor |
|
351 |
*/ |
|
352 |
R visitProperty(PropertyTree node, P p); |
|
353 |
||
354 |
/** |
|
355 |
* Visit regular expression literal tree. |
|
356 |
* |
|
357 |
* @param node node being visited |
|
358 |
* @param p extra parameter passed to the visitor |
|
359 |
* @return value from the visitor |
|
360 |
*/ |
|
361 |
R visitRegExpLiteral(RegExpLiteralTree node, P p); |
|
362 |
||
363 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
364 |
* Visit template literal tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
365 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
366 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
367 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
368 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
369 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
370 |
R visitTemplateLiteral(TemplateLiteralTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
371 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
372 |
/** |
29407 | 373 |
* Visit an empty statement tree. |
374 |
* |
|
375 |
* @param node node being visited |
|
376 |
* @param p extra parameter passed to the visitor |
|
377 |
* @return value from the visitor |
|
378 |
*/ |
|
379 |
R visitEmptyStatement(EmptyStatementTree node, P p); |
|
380 |
||
381 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
382 |
* Visit 'spread' expression tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
383 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
384 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
385 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
386 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
387 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
388 |
R visitSpread(SpreadTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
389 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
390 |
/** |
29407 | 391 |
* Visit 'switch' statement tree. |
392 |
* |
|
393 |
* @param node node being visited |
|
394 |
* @param p extra parameter passed to the visitor |
|
395 |
* @return value from the visitor |
|
396 |
*/ |
|
397 |
R visitSwitch(SwitchTree node, P p); |
|
398 |
||
399 |
/** |
|
400 |
* Visit 'throw' expression tree. |
|
401 |
* |
|
402 |
* @param node node being visited |
|
403 |
* @param p extra parameter passed to the visitor |
|
404 |
* @return value from the visitor |
|
405 |
*/ |
|
406 |
R visitThrow(ThrowTree node, P p); |
|
407 |
||
408 |
/** |
|
409 |
* Visit compilation unit tree. |
|
410 |
* |
|
411 |
* @param node node being visited |
|
412 |
* @param p extra parameter passed to the visitor |
|
413 |
* @return value from the visitor |
|
414 |
*/ |
|
415 |
R visitCompilationUnit(CompilationUnitTree node, P p); |
|
416 |
||
417 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
418 |
* Visit Module tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
419 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
420 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
421 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
422 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
423 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
424 |
R visitModule(ModuleTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
425 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
426 |
/** |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
427 |
* Visit Module ExportEntry tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
428 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
429 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
430 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
431 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
432 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
433 |
R visitExportEntry(ExportEntryTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
434 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
435 |
/** |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
436 |
* Visit Module ImportEntry tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
437 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
438 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
439 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
440 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
441 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
442 |
R visitImportEntry(ImportEntryTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
443 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
444 |
/** |
29407 | 445 |
* Visit 'try' statement tree. |
446 |
* |
|
447 |
* @param node node being visited |
|
448 |
* @param p extra parameter passed to the visitor |
|
449 |
* @return value from the visitor |
|
450 |
*/ |
|
451 |
R visitTry(TryTree node, P p); |
|
452 |
||
453 |
/** |
|
454 |
* Visit 'instanceof' expression tree. |
|
455 |
* |
|
456 |
* @param node node being visited |
|
457 |
* @param p extra parameter passed to the visitor |
|
458 |
* @return value from the visitor |
|
459 |
*/ |
|
460 |
R visitInstanceOf(InstanceOfTree node, P p); |
|
461 |
||
462 |
/** |
|
463 |
* Visit unary expression tree. |
|
464 |
* |
|
465 |
* @param node node being visited |
|
466 |
* @param p extra parameter passed to the visitor |
|
467 |
* @return value from the visitor |
|
468 |
*/ |
|
469 |
R visitUnary(UnaryTree node, P p); |
|
470 |
||
471 |
/** |
|
472 |
* Visit variable declaration tree. |
|
473 |
* |
|
474 |
* @param node node being visited |
|
475 |
* @param p extra parameter passed to the visitor |
|
476 |
* @return value from the visitor |
|
477 |
*/ |
|
478 |
R visitVariable(VariableTree node, P p); |
|
479 |
||
480 |
/** |
|
481 |
* Visit 'while' statement tree. |
|
482 |
* |
|
483 |
* @param node node being visited |
|
484 |
* @param p extra parameter passed to the visitor |
|
485 |
* @return value from the visitor |
|
486 |
*/ |
|
487 |
R visitWhileLoop(WhileLoopTree node, P p); |
|
488 |
||
489 |
/** |
|
490 |
* Visit 'with' statement tree. |
|
491 |
* |
|
492 |
* @param node node being visited |
|
493 |
* @param p extra parameter passed to the visitor |
|
494 |
* @return value from the visitor |
|
495 |
*/ |
|
496 |
R visitWith(WithTree node, P p); |
|
497 |
||
498 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
499 |
* Visit 'yield' expression tree. |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
500 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
501 |
* @param node node being visited |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
502 |
* @param p extra parameter passed to the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
503 |
* @return value from the visitor |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
504 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
505 |
R visitYield(YieldTree node, P p); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
506 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
35325
diff
changeset
|
507 |
/** |
29407 | 508 |
* Visit unknown expression/statement tree. This fallback will be |
509 |
* called if new Tree subtypes are introduced in future. A specific |
|
510 |
* implementation may throw {{@linkplain UnknownTreeException unknown tree exception} |
|
511 |
* if the visitor implementation was for an older language version. |
|
512 |
* |
|
513 |
* @param node node being visited |
|
514 |
* @param p extra parameter passed to the visitor |
|
515 |
* @return value from the visitor |
|
516 |
*/ |
|
517 |
R visitUnknown(Tree node, P p); |
|
518 |
} |