author | sundar |
Tue, 12 Jul 2016 21:18:13 +0530 | |
changeset 39662 | e2b36a3779b9 |
parent 37732 | 3673fec68d16 |
permissions | -rw-r--r-- |
16147 | 1 |
/* |
16151 | 2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
16147 | 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.internal.ir.visitor; |
|
27 |
||
28 |
import jdk.nashorn.internal.ir.AccessNode; |
|
29 |
import jdk.nashorn.internal.ir.BinaryNode; |
|
30 |
import jdk.nashorn.internal.ir.Block; |
|
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
31 |
import jdk.nashorn.internal.ir.BlockStatement; |
16147 | 32 |
import jdk.nashorn.internal.ir.BreakNode; |
33 |
import jdk.nashorn.internal.ir.CallNode; |
|
34 |
import jdk.nashorn.internal.ir.CaseNode; |
|
35 |
import jdk.nashorn.internal.ir.CatchNode; |
|
37732 | 36 |
import jdk.nashorn.internal.ir.ClassNode; |
16147 | 37 |
import jdk.nashorn.internal.ir.ContinueNode; |
29407 | 38 |
import jdk.nashorn.internal.ir.DebuggerNode; |
16147 | 39 |
import jdk.nashorn.internal.ir.EmptyNode; |
29407 | 40 |
import jdk.nashorn.internal.ir.ErrorNode; |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
41 |
import jdk.nashorn.internal.ir.ExpressionStatement; |
16147 | 42 |
import jdk.nashorn.internal.ir.ForNode; |
43 |
import jdk.nashorn.internal.ir.FunctionNode; |
|
27206 | 44 |
import jdk.nashorn.internal.ir.GetSplitState; |
16147 | 45 |
import jdk.nashorn.internal.ir.IdentNode; |
46 |
import jdk.nashorn.internal.ir.IfNode; |
|
47 |
import jdk.nashorn.internal.ir.IndexNode; |
|
24751 | 48 |
import jdk.nashorn.internal.ir.JoinPredecessorExpression; |
28690 | 49 |
import jdk.nashorn.internal.ir.JumpToInlinedFinally; |
16147 | 50 |
import jdk.nashorn.internal.ir.LabelNode; |
17233 | 51 |
import jdk.nashorn.internal.ir.LexicalContext; |
16147 | 52 |
import jdk.nashorn.internal.ir.LiteralNode; |
53 |
import jdk.nashorn.internal.ir.Node; |
|
54 |
import jdk.nashorn.internal.ir.ObjectNode; |
|
55 |
import jdk.nashorn.internal.ir.PropertyNode; |
|
56 |
import jdk.nashorn.internal.ir.ReturnNode; |
|
57 |
import jdk.nashorn.internal.ir.RuntimeNode; |
|
27206 | 58 |
import jdk.nashorn.internal.ir.SetSplitState; |
16147 | 59 |
import jdk.nashorn.internal.ir.SplitNode; |
27206 | 60 |
import jdk.nashorn.internal.ir.SplitReturn; |
16147 | 61 |
import jdk.nashorn.internal.ir.SwitchNode; |
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
62 |
import jdk.nashorn.internal.ir.TemplateLiteral; |
16147 | 63 |
import jdk.nashorn.internal.ir.TernaryNode; |
64 |
import jdk.nashorn.internal.ir.ThrowNode; |
|
65 |
import jdk.nashorn.internal.ir.TryNode; |
|
66 |
import jdk.nashorn.internal.ir.UnaryNode; |
|
67 |
import jdk.nashorn.internal.ir.VarNode; |
|
68 |
import jdk.nashorn.internal.ir.WhileNode; |
|
69 |
import jdk.nashorn.internal.ir.WithNode; |
|
70 |
||
71 |
/** |
|
72 |
* Visitor used to navigate the IR. |
|
17769
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
73 |
* @param <T> lexical context class used by this visitor |
16147 | 74 |
*/ |
17769
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
75 |
public abstract class NodeVisitor<T extends LexicalContext> { |
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
76 |
/** lexical context in use */ |
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
77 |
protected final T lc; |
16147 | 78 |
|
79 |
/** |
|
80 |
* Constructor |
|
81 |
* |
|
17233 | 82 |
* @param lc a custom lexical context |
16147 | 83 |
*/ |
17769
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
84 |
public NodeVisitor(final T lc) { |
17233 | 85 |
this.lc = lc; |
86 |
} |
|
16147 | 87 |
|
17233 | 88 |
/** |
89 |
* Get the lexical context of this node visitor |
|
90 |
* @return lexical context |
|
91 |
*/ |
|
17769
14ea7feaf658
8012522: Clean up lexical contexts - split out stack based functionality in CodeGenerator and generify NodeVisitors based on their LexicalContext type to avoid casts
lagergren
parents:
17524
diff
changeset
|
92 |
public T getLexicalContext() { |
17233 | 93 |
return lc; |
16147 | 94 |
} |
95 |
||
96 |
/** |
|
97 |
* Override this method to do a double inheritance pattern, e.g. avoid |
|
98 |
* using |
|
99 |
* <p> |
|
100 |
* if (x instanceof NodeTypeA) { |
|
101 |
* ... |
|
102 |
* } else if (x instanceof NodeTypeB) { |
|
103 |
* ... |
|
104 |
* } else { |
|
105 |
* ... |
|
106 |
* } |
|
107 |
* <p> |
|
108 |
* Use a NodeVisitor instead, and this method contents forms the else case. |
|
109 |
* |
|
110 |
* @see NodeVisitor#leaveDefault(Node) |
|
111 |
* @param node the node to visit |
|
17233 | 112 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 113 |
*/ |
17233 | 114 |
protected boolean enterDefault(final Node node) { |
115 |
return true; |
|
16147 | 116 |
} |
117 |
||
118 |
/** |
|
119 |
* Override this method to do a double inheritance pattern, e.g. avoid |
|
120 |
* using |
|
121 |
* <p> |
|
122 |
* if (x instanceof NodeTypeA) { |
|
123 |
* ... |
|
124 |
* } else if (x instanceof NodeTypeB) { |
|
125 |
* ... |
|
126 |
* } else { |
|
127 |
* ... |
|
128 |
* } |
|
129 |
* <p> |
|
130 |
* Use a NodeVisitor instead, and this method contents forms the else case. |
|
131 |
* |
|
132 |
* @see NodeVisitor#enterDefault(Node) |
|
133 |
* @param node the node to visit |
|
134 |
* @return the node |
|
135 |
*/ |
|
136 |
protected Node leaveDefault(final Node node) { |
|
137 |
return node; |
|
138 |
} |
|
139 |
||
140 |
/** |
|
141 |
* Callback for entering an AccessNode |
|
142 |
* |
|
143 |
* @param accessNode the node |
|
17233 | 144 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 145 |
*/ |
17233 | 146 |
public boolean enterAccessNode(final AccessNode accessNode) { |
16147 | 147 |
return enterDefault(accessNode); |
148 |
} |
|
149 |
||
150 |
/** |
|
151 |
* Callback for entering an AccessNode |
|
152 |
* |
|
153 |
* @param accessNode the node |
|
154 |
* @return processed node, null if traversal should end |
|
155 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
156 |
public Node leaveAccessNode(final AccessNode accessNode) { |
16147 | 157 |
return leaveDefault(accessNode); |
158 |
} |
|
159 |
||
160 |
/** |
|
161 |
* Callback for entering a Block |
|
162 |
* |
|
163 |
* @param block the node |
|
17233 | 164 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 165 |
*/ |
17233 | 166 |
public boolean enterBlock(final Block block) { |
16147 | 167 |
return enterDefault(block); |
168 |
} |
|
169 |
||
170 |
/** |
|
171 |
* Callback for leaving a Block |
|
172 |
* |
|
173 |
* @param block the node |
|
174 |
* @return processed node, which will replace the original one, or the original node |
|
175 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
176 |
public Node leaveBlock(final Block block) { |
16147 | 177 |
return leaveDefault(block); |
178 |
} |
|
179 |
||
180 |
/** |
|
181 |
* Callback for entering a BinaryNode |
|
182 |
* |
|
183 |
* @param binaryNode the node |
|
184 |
* @return processed node |
|
185 |
*/ |
|
17233 | 186 |
public boolean enterBinaryNode(final BinaryNode binaryNode) { |
16147 | 187 |
return enterDefault(binaryNode); |
188 |
} |
|
189 |
||
190 |
/** |
|
191 |
* Callback for leaving a BinaryNode |
|
192 |
* |
|
193 |
* @param binaryNode the node |
|
194 |
* @return processed node, which will replace the original one, or the original node |
|
195 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
196 |
public Node leaveBinaryNode(final BinaryNode binaryNode) { |
16147 | 197 |
return leaveDefault(binaryNode); |
198 |
} |
|
199 |
||
200 |
/** |
|
201 |
* Callback for entering a BreakNode |
|
202 |
* |
|
203 |
* @param breakNode the node |
|
17233 | 204 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 205 |
*/ |
17233 | 206 |
public boolean enterBreakNode(final BreakNode breakNode) { |
16147 | 207 |
return enterDefault(breakNode); |
208 |
} |
|
209 |
||
210 |
/** |
|
211 |
* Callback for leaving a BreakNode |
|
212 |
* |
|
213 |
* @param breakNode the node |
|
214 |
* @return processed node, which will replace the original one, or the original node |
|
215 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
216 |
public Node leaveBreakNode(final BreakNode breakNode) { |
16147 | 217 |
return leaveDefault(breakNode); |
218 |
} |
|
219 |
||
220 |
/** |
|
221 |
* Callback for entering a CallNode |
|
222 |
* |
|
223 |
* @param callNode the node |
|
17233 | 224 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 225 |
*/ |
17233 | 226 |
public boolean enterCallNode(final CallNode callNode) { |
16147 | 227 |
return enterDefault(callNode); |
228 |
} |
|
229 |
||
230 |
/** |
|
231 |
* Callback for leaving a CallNode |
|
232 |
* |
|
233 |
* @param callNode the node |
|
234 |
* @return processed node, which will replace the original one, or the original node |
|
235 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
236 |
public Node leaveCallNode(final CallNode callNode) { |
16147 | 237 |
return leaveDefault(callNode); |
238 |
} |
|
239 |
||
240 |
/** |
|
241 |
* Callback for entering a CaseNode |
|
242 |
* |
|
243 |
* @param caseNode the node |
|
17233 | 244 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 245 |
*/ |
17233 | 246 |
public boolean enterCaseNode(final CaseNode caseNode) { |
16147 | 247 |
return enterDefault(caseNode); |
248 |
} |
|
249 |
||
250 |
/** |
|
251 |
* Callback for leaving a CaseNode |
|
252 |
* |
|
253 |
* @param caseNode the node |
|
254 |
* @return processed node, which will replace the original one, or the original node |
|
255 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
256 |
public Node leaveCaseNode(final CaseNode caseNode) { |
16147 | 257 |
return leaveDefault(caseNode); |
258 |
} |
|
259 |
||
260 |
/** |
|
261 |
* Callback for entering a CatchNode |
|
262 |
* |
|
263 |
* @param catchNode the node |
|
17233 | 264 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 265 |
*/ |
17233 | 266 |
public boolean enterCatchNode(final CatchNode catchNode) { |
16147 | 267 |
return enterDefault(catchNode); |
268 |
} |
|
269 |
||
270 |
/** |
|
271 |
* Callback for leaving a CatchNode |
|
272 |
* |
|
273 |
* @param catchNode the node |
|
274 |
* @return processed node, which will replace the original one, or the original node |
|
275 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
276 |
public Node leaveCatchNode(final CatchNode catchNode) { |
16147 | 277 |
return leaveDefault(catchNode); |
278 |
} |
|
279 |
||
280 |
/** |
|
281 |
* Callback for entering a ContinueNode |
|
282 |
* |
|
283 |
* @param continueNode the node |
|
17233 | 284 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 285 |
*/ |
17233 | 286 |
public boolean enterContinueNode(final ContinueNode continueNode) { |
16147 | 287 |
return enterDefault(continueNode); |
288 |
} |
|
289 |
||
290 |
/** |
|
291 |
* Callback for leaving a ContinueNode |
|
292 |
* |
|
293 |
* @param continueNode the node |
|
294 |
* @return processed node, which will replace the original one, or the original node |
|
295 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
296 |
public Node leaveContinueNode(final ContinueNode continueNode) { |
16147 | 297 |
return leaveDefault(continueNode); |
298 |
} |
|
299 |
||
29407 | 300 |
|
301 |
/** |
|
302 |
* Callback for entering a DebuggerNode |
|
303 |
* |
|
304 |
* @param debuggerNode the node |
|
305 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
306 |
*/ |
|
307 |
public boolean enterDebuggerNode(final DebuggerNode debuggerNode) { |
|
308 |
return enterDefault(debuggerNode); |
|
309 |
} |
|
310 |
||
311 |
/** |
|
312 |
* Callback for leaving a DebuggerNode |
|
313 |
* |
|
314 |
* @param debuggerNode the node |
|
315 |
* @return processed node, which will replace the original one, or the original node |
|
316 |
*/ |
|
317 |
public Node leaveDebuggerNode(final DebuggerNode debuggerNode) { |
|
318 |
return leaveDefault(debuggerNode); |
|
319 |
} |
|
320 |
||
16147 | 321 |
/** |
322 |
* Callback for entering an EmptyNode |
|
323 |
* |
|
324 |
* @param emptyNode the node |
|
17233 | 325 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 326 |
*/ |
17233 | 327 |
public boolean enterEmptyNode(final EmptyNode emptyNode) { |
16147 | 328 |
return enterDefault(emptyNode); |
329 |
} |
|
330 |
||
331 |
/** |
|
332 |
* Callback for leaving an EmptyNode |
|
333 |
* |
|
334 |
* @param emptyNode the node |
|
335 |
* @return processed node, which will replace the original one, or the original node |
|
336 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
337 |
public Node leaveEmptyNode(final EmptyNode emptyNode) { |
16147 | 338 |
return leaveDefault(emptyNode); |
339 |
} |
|
340 |
||
341 |
/** |
|
29407 | 342 |
* Callback for entering an ErrorNode |
343 |
* |
|
344 |
* @param errorNode the node |
|
345 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
346 |
*/ |
|
347 |
public boolean enterErrorNode(final ErrorNode errorNode) { |
|
348 |
return enterDefault(errorNode); |
|
349 |
} |
|
350 |
||
351 |
/** |
|
352 |
* Callback for leaving an ErrorNode |
|
353 |
* |
|
354 |
* @param errorNode the node |
|
355 |
* @return processed node, which will replace the original one, or the original node |
|
356 |
*/ |
|
357 |
public Node leaveErrorNode(final ErrorNode errorNode) { |
|
358 |
return leaveDefault(errorNode); |
|
359 |
} |
|
360 |
||
361 |
/** |
|
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
362 |
* Callback for entering an ExpressionStatement |
16147 | 363 |
* |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
364 |
* @param expressionStatement the node |
17233 | 365 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 366 |
*/ |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
367 |
public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) { |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
368 |
return enterDefault(expressionStatement); |
16147 | 369 |
} |
370 |
||
371 |
/** |
|
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
372 |
* Callback for leaving an ExpressionStatement |
16147 | 373 |
* |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
374 |
* @param expressionStatement the node |
16147 | 375 |
* @return processed node, which will replace the original one, or the original node |
376 |
*/ |
|
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
377 |
public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) { |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
378 |
return leaveDefault(expressionStatement); |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
379 |
} |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
380 |
|
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
381 |
/** |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
382 |
* Callback for entering a BlockStatement |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
383 |
* |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
384 |
* @param blockStatement the node |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
385 |
* @return true if traversal should continue and node children be traversed, false otherwise |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
386 |
*/ |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
387 |
public boolean enterBlockStatement(final BlockStatement blockStatement) { |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
388 |
return enterDefault(blockStatement); |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
389 |
} |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
390 |
|
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
391 |
/** |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
392 |
* Callback for leaving a BlockStatement |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
393 |
* |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
394 |
* @param blockStatement the node |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
395 |
* @return processed node, which will replace the original one, or the original node |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
396 |
*/ |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
397 |
public Node leaveBlockStatement(final BlockStatement blockStatement) { |
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
17769
diff
changeset
|
398 |
return leaveDefault(blockStatement); |
16147 | 399 |
} |
400 |
||
401 |
/** |
|
402 |
* Callback for entering a ForNode |
|
403 |
* |
|
404 |
* @param forNode the node |
|
17233 | 405 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 406 |
*/ |
17233 | 407 |
public boolean enterForNode(final ForNode forNode) { |
16147 | 408 |
return enterDefault(forNode); |
409 |
} |
|
410 |
||
411 |
/** |
|
412 |
* Callback for leaving a ForNode |
|
413 |
* |
|
414 |
* @param forNode the node |
|
415 |
* @return processed node, which will replace the original one, or the original node |
|
416 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
417 |
public Node leaveForNode(final ForNode forNode) { |
16147 | 418 |
return leaveDefault(forNode); |
419 |
} |
|
420 |
||
421 |
/** |
|
422 |
* Callback for entering a FunctionNode |
|
423 |
* |
|
424 |
* @param functionNode the node |
|
17233 | 425 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 426 |
*/ |
17233 | 427 |
public boolean enterFunctionNode(final FunctionNode functionNode) { |
16147 | 428 |
return enterDefault(functionNode); |
429 |
} |
|
430 |
||
431 |
/** |
|
432 |
* Callback for leaving a FunctionNode |
|
433 |
* |
|
434 |
* @param functionNode the node |
|
435 |
* @return processed node, which will replace the original one, or the original node |
|
436 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
437 |
public Node leaveFunctionNode(final FunctionNode functionNode) { |
16147 | 438 |
return leaveDefault(functionNode); |
439 |
} |
|
440 |
||
441 |
/** |
|
27206 | 442 |
* Callback for entering a {@link GetSplitState}. |
443 |
* |
|
444 |
* @param getSplitState the get split state expression |
|
445 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
446 |
*/ |
|
447 |
public boolean enterGetSplitState(final GetSplitState getSplitState) { |
|
448 |
return enterDefault(getSplitState); |
|
449 |
} |
|
450 |
||
451 |
/** |
|
452 |
* Callback for leaving a {@link GetSplitState}. |
|
453 |
* |
|
454 |
* @param getSplitState the get split state expression |
|
455 |
* @return processed node, which will replace the original one, or the original node |
|
456 |
*/ |
|
457 |
public Node leaveGetSplitState(final GetSplitState getSplitState) { |
|
458 |
return leaveDefault(getSplitState); |
|
459 |
} |
|
460 |
||
461 |
/** |
|
16147 | 462 |
* Callback for entering an IdentNode |
463 |
* |
|
464 |
* @param identNode the node |
|
17233 | 465 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 466 |
*/ |
17233 | 467 |
public boolean enterIdentNode(final IdentNode identNode) { |
16147 | 468 |
return enterDefault(identNode); |
469 |
} |
|
470 |
||
471 |
/** |
|
472 |
* Callback for leaving an IdentNode |
|
473 |
* |
|
474 |
* @param identNode the node |
|
475 |
* @return processed node, which will replace the original one, or the original node |
|
476 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
477 |
public Node leaveIdentNode(final IdentNode identNode) { |
16147 | 478 |
return leaveDefault(identNode); |
479 |
} |
|
480 |
||
481 |
/** |
|
482 |
* Callback for entering an IfNode |
|
483 |
* |
|
17233 | 484 |
* @param ifNode the node |
485 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
16147 | 486 |
*/ |
17233 | 487 |
public boolean enterIfNode(final IfNode ifNode) { |
16147 | 488 |
return enterDefault(ifNode); |
489 |
} |
|
490 |
||
491 |
/** |
|
492 |
* Callback for leaving an IfNode |
|
493 |
* |
|
494 |
* @param ifNode the node |
|
495 |
* @return processed node, which will replace the original one, or the original node |
|
496 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
497 |
public Node leaveIfNode(final IfNode ifNode) { |
16147 | 498 |
return leaveDefault(ifNode); |
499 |
} |
|
500 |
||
501 |
/** |
|
502 |
* Callback for entering an IndexNode |
|
503 |
* |
|
504 |
* @param indexNode the node |
|
17233 | 505 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 506 |
*/ |
17233 | 507 |
public boolean enterIndexNode(final IndexNode indexNode) { |
16147 | 508 |
return enterDefault(indexNode); |
509 |
} |
|
510 |
||
511 |
/** |
|
512 |
* Callback for leaving an IndexNode |
|
513 |
* |
|
514 |
* @param indexNode the node |
|
515 |
* @return processed node, which will replace the original one, or the original node |
|
516 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
517 |
public Node leaveIndexNode(final IndexNode indexNode) { |
16147 | 518 |
return leaveDefault(indexNode); |
519 |
} |
|
520 |
||
521 |
/** |
|
28690 | 522 |
* Callback for entering a JumpToInlinedFinally |
523 |
* |
|
524 |
* @param jumpToInlinedFinally the node |
|
525 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
526 |
*/ |
|
527 |
public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) { |
|
528 |
return enterDefault(jumpToInlinedFinally); |
|
529 |
} |
|
530 |
||
531 |
/** |
|
532 |
* Callback for leaving a JumpToInlinedFinally |
|
533 |
* |
|
534 |
* @param jumpToInlinedFinally the node |
|
535 |
* @return processed node, which will replace the original one, or the original node |
|
536 |
*/ |
|
537 |
public Node leaveJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) { |
|
538 |
return leaveDefault(jumpToInlinedFinally); |
|
539 |
} |
|
540 |
||
541 |
/** |
|
16147 | 542 |
* Callback for entering a LabelNode |
543 |
* |
|
544 |
* @param labelNode the node |
|
17233 | 545 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 546 |
*/ |
17233 | 547 |
public boolean enterLabelNode(final LabelNode labelNode) { |
16147 | 548 |
return enterDefault(labelNode); |
549 |
} |
|
550 |
||
551 |
/** |
|
552 |
* Callback for leaving a LabelNode |
|
553 |
* |
|
554 |
* @param labelNode the node |
|
555 |
* @return processed node, which will replace the original one, or the original node |
|
556 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
557 |
public Node leaveLabelNode(final LabelNode labelNode) { |
16147 | 558 |
return leaveDefault(labelNode); |
559 |
} |
|
560 |
||
561 |
/** |
|
562 |
* Callback for entering a LiteralNode |
|
563 |
* |
|
564 |
* @param literalNode the node |
|
17233 | 565 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 566 |
*/ |
17233 | 567 |
public boolean enterLiteralNode(final LiteralNode<?> literalNode) { |
16147 | 568 |
return enterDefault(literalNode); |
569 |
} |
|
570 |
||
571 |
/** |
|
572 |
* Callback for leaving a LiteralNode |
|
573 |
* |
|
574 |
* @param literalNode the node |
|
575 |
* @return processed node, which will replace the original one, or the original node |
|
576 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
577 |
public Node leaveLiteralNode(final LiteralNode<?> literalNode) { |
16147 | 578 |
return leaveDefault(literalNode); |
579 |
} |
|
580 |
||
581 |
/** |
|
582 |
* Callback for entering an ObjectNode |
|
583 |
* |
|
584 |
* @param objectNode the node |
|
17233 | 585 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 586 |
*/ |
17233 | 587 |
public boolean enterObjectNode(final ObjectNode objectNode) { |
16147 | 588 |
return enterDefault(objectNode); |
589 |
} |
|
590 |
||
591 |
/** |
|
592 |
* Callback for leaving an ObjectNode |
|
593 |
* |
|
594 |
* @param objectNode the node |
|
595 |
* @return processed node, which will replace the original one, or the original node |
|
596 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
597 |
public Node leaveObjectNode(final ObjectNode objectNode) { |
16147 | 598 |
return leaveDefault(objectNode); |
599 |
} |
|
600 |
||
601 |
/** |
|
602 |
* Callback for entering a PropertyNode |
|
603 |
* |
|
604 |
* @param propertyNode the node |
|
17233 | 605 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 606 |
*/ |
17233 | 607 |
public boolean enterPropertyNode(final PropertyNode propertyNode) { |
16147 | 608 |
return enterDefault(propertyNode); |
609 |
} |
|
610 |
||
611 |
/** |
|
612 |
* Callback for leaving a PropertyNode |
|
613 |
* |
|
614 |
* @param propertyNode the node |
|
615 |
* @return processed node, which will replace the original one, or the original node |
|
616 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
617 |
public Node leavePropertyNode(final PropertyNode propertyNode) { |
16147 | 618 |
return leaveDefault(propertyNode); |
619 |
} |
|
620 |
||
621 |
/** |
|
622 |
* Callback for entering a ReturnNode |
|
623 |
* |
|
624 |
* @param returnNode the node |
|
17233 | 625 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 626 |
*/ |
17233 | 627 |
public boolean enterReturnNode(final ReturnNode returnNode) { |
16147 | 628 |
return enterDefault(returnNode); |
629 |
} |
|
630 |
||
631 |
/** |
|
632 |
* Callback for leaving a ReturnNode |
|
633 |
* |
|
634 |
* @param returnNode the node |
|
635 |
* @return processed node, which will replace the original one, or the original node |
|
636 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
637 |
public Node leaveReturnNode(final ReturnNode returnNode) { |
16147 | 638 |
return leaveDefault(returnNode); |
639 |
} |
|
640 |
||
641 |
/** |
|
642 |
* Callback for entering a RuntimeNode |
|
643 |
* |
|
644 |
* @param runtimeNode the node |
|
17233 | 645 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 646 |
*/ |
17233 | 647 |
public boolean enterRuntimeNode(final RuntimeNode runtimeNode) { |
16147 | 648 |
return enterDefault(runtimeNode); |
649 |
} |
|
650 |
||
651 |
/** |
|
652 |
* Callback for leaving a RuntimeNode |
|
653 |
* |
|
654 |
* @param runtimeNode the node |
|
655 |
* @return processed node, which will replace the original one, or the original node |
|
656 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
657 |
public Node leaveRuntimeNode(final RuntimeNode runtimeNode) { |
16147 | 658 |
return leaveDefault(runtimeNode); |
659 |
} |
|
660 |
||
661 |
/** |
|
27206 | 662 |
* Callback for entering a {@link SetSplitState}. |
663 |
* |
|
664 |
* @param setSplitState the set split state statement |
|
665 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
666 |
*/ |
|
667 |
public boolean enterSetSplitState(final SetSplitState setSplitState) { |
|
668 |
return enterDefault(setSplitState); |
|
669 |
} |
|
670 |
||
671 |
/** |
|
672 |
* Callback for leaving a {@link SetSplitState}. |
|
673 |
* |
|
674 |
* @param setSplitState the set split state expression |
|
675 |
* @return processed node, which will replace the original one, or the original node |
|
676 |
*/ |
|
677 |
public Node leaveSetSplitState(final SetSplitState setSplitState) { |
|
678 |
return leaveDefault(setSplitState); |
|
679 |
} |
|
680 |
||
681 |
/** |
|
16147 | 682 |
* Callback for entering a SplitNode |
683 |
* |
|
684 |
* @param splitNode the node |
|
17233 | 685 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 686 |
*/ |
17233 | 687 |
public boolean enterSplitNode(final SplitNode splitNode) { |
16147 | 688 |
return enterDefault(splitNode); |
689 |
} |
|
690 |
||
691 |
/** |
|
692 |
* Callback for leaving a SplitNode |
|
693 |
* |
|
694 |
* @param splitNode the node |
|
695 |
* @return processed node, which will replace the original one, or the original node |
|
696 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
697 |
public Node leaveSplitNode(final SplitNode splitNode) { |
16147 | 698 |
return leaveDefault(splitNode); |
699 |
} |
|
700 |
||
701 |
/** |
|
27206 | 702 |
* Callback for entering a SplitReturn |
703 |
* |
|
704 |
* @param splitReturn the node |
|
705 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
706 |
*/ |
|
707 |
public boolean enterSplitReturn(final SplitReturn splitReturn) { |
|
708 |
return enterDefault(splitReturn); |
|
709 |
} |
|
710 |
||
711 |
/** |
|
712 |
* Callback for leaving a SplitReturn |
|
713 |
* |
|
714 |
* @param splitReturn the node |
|
715 |
* @return processed node, which will replace the original one, or the original node |
|
716 |
*/ |
|
717 |
public Node leaveSplitReturn(final SplitReturn splitReturn) { |
|
718 |
return leaveDefault(splitReturn); |
|
719 |
} |
|
720 |
||
721 |
/** |
|
16147 | 722 |
* Callback for entering a SwitchNode |
723 |
* |
|
724 |
* @param switchNode the node |
|
17233 | 725 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 726 |
*/ |
17233 | 727 |
public boolean enterSwitchNode(final SwitchNode switchNode) { |
16147 | 728 |
return enterDefault(switchNode); |
729 |
} |
|
730 |
||
731 |
/** |
|
732 |
* Callback for leaving a SwitchNode |
|
733 |
* |
|
734 |
* @param switchNode the node |
|
735 |
* @return processed node, which will replace the original one, or the original node |
|
736 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
737 |
public Node leaveSwitchNode(final SwitchNode switchNode) { |
16147 | 738 |
return leaveDefault(switchNode); |
739 |
} |
|
740 |
||
741 |
/** |
|
39662
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
742 |
* Callback for entering a TemplateLiteral (used only in --parse-only mode) |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
743 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
744 |
* @param templateLiteral the node |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
745 |
* @return true if traversal should continue and node children be traversed, false otherwise |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
746 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
747 |
public boolean enterTemplateLiteral(final TemplateLiteral templateLiteral) { |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
748 |
return enterDefault(templateLiteral); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
749 |
} |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
750 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
751 |
/** |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
752 |
* Callback for leaving a TemplateLiteral (used only in --parse-only mode) |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
753 |
* |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
754 |
* @param templateLiteral the node |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
755 |
* @return processed node, which will replace the original one, or the original node |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
756 |
*/ |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
757 |
public Node leaveTemplateLiteral(final TemplateLiteral templateLiteral) { |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
758 |
return leaveDefault(templateLiteral); |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
759 |
} |
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
760 |
|
e2b36a3779b9
8149929: Nashorn Parser API needs to be updated for ES6
sundar
parents:
37732
diff
changeset
|
761 |
/** |
16147 | 762 |
* Callback for entering a TernaryNode |
763 |
* |
|
764 |
* @param ternaryNode the node |
|
17233 | 765 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 766 |
*/ |
17233 | 767 |
public boolean enterTernaryNode(final TernaryNode ternaryNode) { |
16147 | 768 |
return enterDefault(ternaryNode); |
769 |
} |
|
770 |
||
771 |
/** |
|
772 |
* Callback for leaving a TernaryNode |
|
773 |
* |
|
774 |
* @param ternaryNode the node |
|
775 |
* @return processed node, which will replace the original one, or the original node |
|
776 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
777 |
public Node leaveTernaryNode(final TernaryNode ternaryNode) { |
16147 | 778 |
return leaveDefault(ternaryNode); |
779 |
} |
|
780 |
||
781 |
/** |
|
782 |
* Callback for entering a ThrowNode |
|
783 |
* |
|
784 |
* @param throwNode the node |
|
17233 | 785 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 786 |
*/ |
17233 | 787 |
public boolean enterThrowNode(final ThrowNode throwNode) { |
16147 | 788 |
return enterDefault(throwNode); |
789 |
} |
|
790 |
||
791 |
/** |
|
792 |
* Callback for leaving a ThrowNode |
|
793 |
* |
|
794 |
* @param throwNode the node |
|
795 |
* @return processed node, which will replace the original one, or the original node |
|
796 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
797 |
public Node leaveThrowNode(final ThrowNode throwNode) { |
16147 | 798 |
return leaveDefault(throwNode); |
799 |
} |
|
800 |
||
801 |
/** |
|
802 |
* Callback for entering a TryNode |
|
803 |
* |
|
804 |
* @param tryNode the node |
|
17233 | 805 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 806 |
*/ |
17233 | 807 |
public boolean enterTryNode(final TryNode tryNode) { |
16147 | 808 |
return enterDefault(tryNode); |
809 |
} |
|
810 |
||
811 |
/** |
|
812 |
* Callback for leaving a TryNode |
|
813 |
* |
|
814 |
* @param tryNode the node |
|
815 |
* @return processed node, which will replace the original one, or the original node |
|
816 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
817 |
public Node leaveTryNode(final TryNode tryNode) { |
16147 | 818 |
return leaveDefault(tryNode); |
819 |
} |
|
820 |
||
821 |
/** |
|
822 |
* Callback for entering a UnaryNode |
|
823 |
* |
|
824 |
* @param unaryNode the node |
|
17233 | 825 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 826 |
*/ |
17233 | 827 |
public boolean enterUnaryNode(final UnaryNode unaryNode) { |
16147 | 828 |
return enterDefault(unaryNode); |
829 |
} |
|
830 |
||
831 |
/** |
|
832 |
* Callback for leaving a UnaryNode |
|
833 |
* |
|
834 |
* @param unaryNode the node |
|
835 |
* @return processed node, which will replace the original one, or the original node |
|
836 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
837 |
public Node leaveUnaryNode(final UnaryNode unaryNode) { |
16147 | 838 |
return leaveDefault(unaryNode); |
839 |
} |
|
840 |
||
841 |
/** |
|
24751 | 842 |
* Callback for entering a {@link JoinPredecessorExpression}. |
843 |
* |
|
844 |
* @param expr the join predecessor expression |
|
845 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
846 |
*/ |
|
847 |
public boolean enterJoinPredecessorExpression(final JoinPredecessorExpression expr) { |
|
848 |
return enterDefault(expr); |
|
849 |
} |
|
850 |
||
851 |
/** |
|
852 |
* Callback for leaving a {@link JoinPredecessorExpression}. |
|
853 |
* |
|
854 |
* @param expr the join predecessor expression |
|
855 |
* @return processed node, which will replace the original one, or the original node |
|
856 |
*/ |
|
857 |
public Node leaveJoinPredecessorExpression(final JoinPredecessorExpression expr) { |
|
858 |
return leaveDefault(expr); |
|
859 |
} |
|
860 |
||
861 |
||
862 |
/** |
|
16147 | 863 |
* Callback for entering a VarNode |
864 |
* |
|
865 |
* @param varNode the node |
|
17233 | 866 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 867 |
*/ |
17233 | 868 |
public boolean enterVarNode(final VarNode varNode) { |
16147 | 869 |
return enterDefault(varNode); |
870 |
} |
|
871 |
||
872 |
/** |
|
873 |
* Callback for leaving a VarNode |
|
874 |
* |
|
875 |
* @param varNode the node |
|
876 |
* @return processed node, which will replace the original one, or the original node |
|
877 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
878 |
public Node leaveVarNode(final VarNode varNode) { |
16147 | 879 |
return leaveDefault(varNode); |
880 |
} |
|
881 |
||
882 |
/** |
|
883 |
* Callback for entering a WhileNode |
|
884 |
* |
|
885 |
* @param whileNode the node |
|
17233 | 886 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 887 |
*/ |
17233 | 888 |
public boolean enterWhileNode(final WhileNode whileNode) { |
16147 | 889 |
return enterDefault(whileNode); |
890 |
} |
|
891 |
||
892 |
/** |
|
893 |
* Callback for leaving a WhileNode |
|
894 |
* |
|
895 |
* @param whileNode the node |
|
896 |
* @return processed node, which will replace the original one, or the original node |
|
897 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
898 |
public Node leaveWhileNode(final WhileNode whileNode) { |
16147 | 899 |
return leaveDefault(whileNode); |
900 |
} |
|
901 |
||
902 |
/** |
|
903 |
* Callback for entering a WithNode |
|
904 |
* |
|
905 |
* @param withNode the node |
|
17233 | 906 |
* @return true if traversal should continue and node children be traversed, false otherwise |
16147 | 907 |
*/ |
17233 | 908 |
public boolean enterWithNode(final WithNode withNode) { |
16147 | 909 |
return enterDefault(withNode); |
910 |
} |
|
911 |
||
912 |
/** |
|
913 |
* Callback for leaving a WithNode |
|
914 |
* |
|
915 |
* @param withNode the node |
|
916 |
* @return processed node, which will replace the original one, or the original node |
|
917 |
*/ |
|
16530
201d682e75f4
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
attila
parents:
16233
diff
changeset
|
918 |
public Node leaveWithNode(final WithNode withNode) { |
16147 | 919 |
return leaveDefault(withNode); |
920 |
} |
|
921 |
||
37732 | 922 |
/** |
923 |
* Callback for entering a ClassNode |
|
924 |
* |
|
925 |
* @param classNode the node |
|
926 |
* @return true if traversal should continue and node children be traversed, false otherwise |
|
927 |
*/ |
|
928 |
public boolean enterClassNode(final ClassNode classNode) { |
|
929 |
return enterDefault(classNode); |
|
930 |
} |
|
16147 | 931 |
|
37732 | 932 |
/** |
933 |
* Callback for leaving a ClassNode |
|
934 |
* |
|
935 |
* @param classNode the node |
|
936 |
* @return processed node, which will replace the original one, or the original node |
|
937 |
*/ |
|
938 |
public Node leaveClassNode(final ClassNode classNode) { |
|
939 |
return leaveDefault(classNode); |
|
940 |
} |
|
16147 | 941 |
} |