public class ASTNode<T extends ASTNode> extends java.lang.Object implements java.lang.Cloneable, Parser.Symbol
| Modifier and Type | Field and Description |
|---|---|
protected ASTNode[] |
children |
static boolean |
generatedWithCacheCycle |
protected int |
numChildren |
protected ASTNode |
parent |
| Constructor and Description |
|---|
ASTNode() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(GVisitor vis) |
void |
addChild(T node) |
java.util.Iterator<T> |
astChildIterator() |
java.lang.Iterable<T> |
astChildren() |
ASTNode<T> |
clone() |
ASTNode<T> |
copy() |
void |
doFullTraversal()
Performs a full traversal of the tree using getChild to trigger rewrites
|
void |
flushAttrAndCollectionCache() |
void |
flushAttrCache() |
void |
flushCache() |
void |
flushCollectionCache() |
void |
flushTreeCache() |
ASTNode<T> |
fullCopy()
Deprecated.
Please use treeCopy or treeCopyNoTransform instead
|
T |
getChild(int i) |
T |
getChildNoTransform(int i)
Gets a child without triggering rewrites.
|
int |
getIndexOfChild(ASTNode node) |
int |
getNumChild() |
int |
getNumChildNoTransform()
Behaves like getNumChild, but does not invoke AST transformations (rewrites).
|
ASTNode |
getParent() |
Parser.SourcePosition |
getPosition() |
void |
init$Children()
Initializes the child array to the correct size.
|
void |
insertChild(ASTNode node,
int i) |
protected boolean |
is$Equal(ASTNode node) |
protected boolean |
is$Equal(ASTNode n1,
ASTNode n2) |
protected int |
numChildren() |
void |
removeChild(int i) |
static ASTState |
resetState() |
ASTNode |
rewrittenNode() |
void |
setChild(ASTNode node,
int i) |
void |
setParent(ASTNode node) |
ASTNode |
setPosition(Parser.Symbol sym) |
ASTState |
state() |
ASTNode<T> |
treeCopy()
Create a deep copy of the AST subtree at this node.
|
ASTNode<T> |
treeCopyNoTransform()
Create a deep copy of the AST subtree at this node.
|
public static final boolean generatedWithCacheCycle
protected ASTNode parent
protected ASTNode[] children
protected int numChildren
public ASTNode setPosition(Parser.Symbol sym)
public Parser.SourcePosition getPosition()
getPosition in interface Parser.Symbolpublic void accept(GVisitor vis)
public void init$Children()
public int getIndexOfChild(ASTNode node)
public final ASTState state()
public static final ASTState resetState()
public java.util.Iterator<T> astChildIterator()
public java.lang.Iterable<T> astChildren()
public T getChild(int i)
public void addChild(T node)
public T getChildNoTransform(int i)
protected int numChildren()
public int getNumChild()
public final int getNumChildNoTransform()
public void setChild(ASTNode node, int i)
public void insertChild(ASTNode node, int i)
public void removeChild(int i)
public ASTNode getParent()
public void setParent(ASTNode node)
public void flushTreeCache()
public void flushCache()
public void flushAttrAndCollectionCache()
public void flushAttrCache()
public void flushCollectionCache()
public ASTNode<T> clone() throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException@Deprecated public ASTNode<T> fullCopy()
public ASTNode<T> treeCopyNoTransform()
public ASTNode<T> treeCopy()
public void doFullTraversal()
protected boolean is$Equal(ASTNode node)
public ASTNode rewrittenNode()