public interface Node extends NodeOps, Copy<Node>, java.io.Serializable
Node
represents an AST node. All AST nodes must implement
this interface. Nodes should be immutable: methods which set fields
of the node should copy the node, set the field in the copy, and then
return the copy.Modifier and Type | Method and Description |
---|---|
NodeOps |
del()
Deprecated.
|
Node |
del(JLDel del)
Deprecated.
|
void |
dump(CodeWriter w)
Dump the AST node for debugging purposes.
|
boolean |
error()
Return true if there an error in this node or its children.
|
Node |
error(boolean flag) |
Ext |
ext()
Get the node's extension.
|
Node |
ext(Ext ext)
Set the extension of the node.
|
Ext |
ext(int n)
Get the node's nth extension, n >= 1.
|
Node |
ext(int n,
Ext ext)
Set the node's nth extension, n >= 1.
|
boolean |
isDisambiguated() |
boolean |
isTypeChecked() |
Position |
position()
Get the position of the node in the source file.
|
Node |
position(Position position)
Create a copy of the node with a new position.
|
Node |
visit(NodeVisitor v)
Visit the node.
|
Node |
visitEdge(Node parent,
NodeVisitor v)
Deprecated.
Call
NodeOps.visitChild(Node, NodeVisitor) instead. |
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
@Deprecated NodeOps del()
Ext ext()
Ext ext(int n)
Position position()
boolean error()
Node error(boolean flag)
boolean isDisambiguated()
boolean isTypeChecked()
Node visit(NodeVisitor v)
visitEdge(null, v)
.v
- The visitor which will traverse/rewrite the AST.this
.@Deprecated Node visitEdge(Node parent, NodeVisitor v)
NodeOps.visitChild(Node, NodeVisitor)
instead.NodeVisitor
to traverse the AST starting at this node.
This method should call the override
, enter
,
and leave
methods of the visitor. The method may return a
new version of the node.parent
- The parent of this
in the AST.v
- The visitor which will traverse/rewrite the AST.this
.void dump(CodeWriter w)