public class TypeClosure extends NodeVisitor
Constructor and Description |
---|
TypeClosure(JLang lang) |
Modifier and Type | Method and Description |
---|---|
Node |
leave(Node parent,
Node old,
Node n,
NodeVisitor v)
This method is called after all of the children of
n
have been visited. |
public TypeClosure(JLang lang)
public Node leave(Node parent, Node old, Node n, NodeVisitor v)
NodeVisitor
n
have been visited. In this case, these children were visited by the
visitor v
. This is the last chance for the visitor to
modify the tree rooted at n
. This method will be called
exactly the same number of times as entry
is called.
That is, for each node that is not overridden, enter
and
leave
are each called exactly once.
Note that if old == n
then the visitor should make a copy
of n
before modifying it. It should then return the
modified copy.
The default implementation of this method is to call
leave(old, n, v)
,
as most subclasses do not need to know the parent of the
node n
.
leave
in class NodeVisitor
parent
- The parent of old
,
null
if old
has no parent.old
- The original state of root of the current subtree.n
- The current state of the root of the current subtree.v
- The NodeVisitor
object used to visit the children.n
.