Package org.extendj.neobeaver.ast
Class Terminals
- java.lang.Object
-
- org.extendj.neobeaver.ast.ASTNode<ASTNode>
-
- org.extendj.neobeaver.ast.GDecl
-
- org.extendj.neobeaver.ast.Terminals
-
- All Implemented Interfaces:
java.lang.Cloneable,Parser.Symbol
public class Terminals extends GDecl implements java.lang.Cloneable
-
-
Field Summary
-
Fields inherited from class org.extendj.neobeaver.ast.ASTNode
children, generatedWithCacheCycle, numChildren, parent
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(GVisitor vis)voidaddSym(GSym node)Append an element to the Sym list.voidaddSymNoTransform(GSym node)Terminalsclone()Terminalscopy()voidflushAttrCache()voidflushCollectionCache()TerminalsfullCopy()Deprecated.Please use treeCopy or treeCopyNoTransform insteadintgetNumSym()Retrieves the number of children in the Sym list.intgetNumSymNoTransform()Retrieves the number of children in the Sym list.GSymgetSym(int i)Retrieves the element at indexiin the Sym list.List<GSym>getSymList()Retrieves the Sym list.List<GSym>getSymListNoTransform()Retrieves the Sym list.GSymgetSymNoTransform(int i)List<GSym>getSyms()Retrieves the Sym list.List<GSym>getSymsNoTransform()Retrieves the Sym list.booleanhasSym()Check whether the Sym list has any children.voidinit$Children()Initializes the child array to the correct size.protected booleanis$Equal(ASTNode node)protected intnumChildren()voidsetSym(GSym node, int i)Replaces the Sym list element at indexiwith the new nodenode.voidsetSymList(List<GSym> list)Replaces the Sym list.TerminalstreeCopy()Create a deep copy of the AST subtree at this node.TerminalstreeCopyNoTransform()Create a deep copy of the AST subtree at this node.-
Methods inherited from class org.extendj.neobeaver.ast.ASTNode
addChild, astChildIterator, astChildren, doFullTraversal, flushAttrAndCollectionCache, flushCache, flushTreeCache, getChild, getChildNoTransform, getIndexOfChild, getNumChild, getNumChildNoTransform, getParent, getPosition, insertChild, is$Equal, removeChild, resetState, rewrittenNode, setChild, setParent, setPosition, state
-
-
-
-
Method Detail
-
init$Children
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.- Overrides:
init$Childrenin classGDecl
-
numChildren
protected int numChildren()
- Overrides:
numChildrenin classGDecl
-
flushAttrCache
public void flushAttrCache()
- Overrides:
flushAttrCachein classGDecl
-
flushCollectionCache
public void flushCollectionCache()
- Overrides:
flushCollectionCachein classGDecl
-
clone
public Terminals clone() throws java.lang.CloneNotSupportedException
-
fullCopy
@Deprecated public Terminals fullCopy()
Deprecated.Please use treeCopy or treeCopyNoTransform insteadCreate a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
-
treeCopyNoTransform
public Terminals treeCopyNoTransform()
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.- Specified by:
treeCopyNoTransformin classGDecl- Returns:
- dangling copy of the subtree at this node
-
treeCopy
public Terminals treeCopy()
Create a deep copy of the AST subtree at this node. The subtree of this node is traversed to trigger rewrites before copy. The copy is dangling, i.e. has no parent.
-
setSymList
public void setSymList(List<GSym> list)
Replaces the Sym list.- Parameters:
list- The new list node to be used as the Sym list.
-
getNumSym
public int getNumSym()
Retrieves the number of children in the Sym list.- Returns:
- Number of children in the Sym list.
-
getNumSymNoTransform
public int getNumSymNoTransform()
Retrieves the number of children in the Sym list. Calling this method will not trigger rewrites.- Returns:
- Number of children in the Sym list.
-
getSym
public GSym getSym(int i)
Retrieves the element at indexiin the Sym list.- Parameters:
i- Index of the element to return.- Returns:
- The element at position
iin the Sym list.
-
hasSym
public boolean hasSym()
Check whether the Sym list has any children.- Returns:
trueif it has at least one child,falseotherwise.
-
addSym
public void addSym(GSym node)
Append an element to the Sym list.- Parameters:
node- The element to append to the Sym list.
-
addSymNoTransform
public void addSymNoTransform(GSym node)
-
setSym
public void setSym(GSym node, int i)
Replaces the Sym list element at indexiwith the new nodenode.- Parameters:
node- The new node to replace the old list element.i- The list index of the node to be replaced.
-
getSymList
@ListChild(name="Sym") public List<GSym> getSymList()
Retrieves the Sym list.- Returns:
- The node representing the Sym list.
-
getSymListNoTransform
public List<GSym> getSymListNoTransform()
Retrieves the Sym list.This method does not invoke AST transformations.
- Returns:
- The node representing the Sym list.
-
getSymNoTransform
public GSym getSymNoTransform(int i)
- Returns:
- the element at index
iin the Sym list without triggering rewrites.
-
getSyms
public List<GSym> getSyms()
Retrieves the Sym list.- Returns:
- The node representing the Sym list.
-
-