public class GProduction extends GDecl implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
tokenString_Name |
children, generatedWithCacheCycle, numChildren, parent| Constructor and Description |
|---|
GProduction() |
GProduction(Opt<Type> p0,
java.lang.String p1,
List<GRule> p2) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(GVisitor vis) |
void |
addGRule(GRule node)
Append an element to the GRule list.
|
void |
addGRuleNoTransform(GRule node) |
GProduction |
clone() |
GProduction |
copy() |
void |
flushAttrCache() |
void |
flushCollectionCache() |
GProduction |
fullCopy()
Deprecated.
Please use treeCopy or treeCopyNoTransform instead
|
GRule |
getGRule(int i)
Retrieves the element at index
i in the GRule list. |
List<GRule> |
getGRuleList()
Retrieves the GRule list.
|
List<GRule> |
getGRuleListNoTransform()
Retrieves the GRule list.
|
GRule |
getGRuleNoTransform(int i) |
List<GRule> |
getGRules()
Retrieves the GRule list.
|
List<GRule> |
getGRulesNoTransform()
Retrieves the GRule list.
|
java.lang.String |
getName()
Retrieves the value for the lexeme Name.
|
int |
getNumGRule()
Retrieves the number of children in the GRule list.
|
int |
getNumGRuleNoTransform()
Retrieves the number of children in the GRule list.
|
Type |
getType()
Retrieves the (optional) Type child.
|
Opt<Type> |
getTypeOpt()
Retrieves the optional node for the Type child.
|
Opt<Type> |
getTypeOptNoTransform()
Retrieves the optional node for child Type.
|
boolean |
hasGRule()
Check whether the GRule list has any children.
|
boolean |
hasType()
Check whether the optional Type child exists.
|
void |
init$Children()
Initializes the child array to the correct size.
|
protected boolean |
is$Equal(ASTNode node) |
protected int |
numChildren() |
void |
setGRule(GRule node,
int i)
Replaces the GRule list element at index
i with the new node node. |
void |
setGRuleList(List<GRule> list)
Replaces the GRule list.
|
void |
setName(java.lang.String value)
Replaces the lexeme Name.
|
void |
setType(Type node)
Replaces the (optional) Type child.
|
void |
setTypeOpt(Opt<Type> opt)
Replaces the optional node for the Type child.
|
GProduction |
treeCopy()
Create a deep copy of the AST subtree at this node.
|
GProduction |
treeCopyNoTransform()
Create a deep copy of the AST subtree at this node.
|
addChild, astChildIterator, astChildren, doFullTraversal, flushAttrAndCollectionCache, flushCache, flushTreeCache, getChild, getChildNoTransform, getIndexOfChild, getNumChild, getNumChildNoTransform, getParent, getPosition, insertChild, is$Equal, removeChild, resetState, rewrittenNode, setChild, setParent, setPosition, statepublic void init$Children()
init$Children in class GDeclprotected int numChildren()
numChildren in class GDeclpublic void flushAttrCache()
flushAttrCache in class GDeclpublic void flushCollectionCache()
flushCollectionCache in class GDeclpublic GProduction clone() throws java.lang.CloneNotSupportedException
public GProduction copy()
@Deprecated public GProduction fullCopy()
public GProduction treeCopyNoTransform()
treeCopyNoTransform in class GDeclpublic GProduction treeCopy()
public void setTypeOpt(Opt<Type> opt)
Opt
node containing the child Type, not the actual child!opt - The new node to be used as the optional node for the Type child.public void setType(Type node)
node - The new node to be used as the Type child.public boolean hasType()
true if the optional Type child exists, false if it does not.public Type getType()
null otherwise.@ASTNodeAnnotation.OptChild(name="Type") public Opt<Type> getTypeOpt()
Opt node containing the child Type, not the actual child!public Opt<Type> getTypeOptNoTransform()
Opt node containing the child Type, not the actual child!
This method does not invoke AST transformations.
public void setName(java.lang.String value)
value - The new value for the lexeme Name.@ASTNodeAnnotation.Token(name="Name") public java.lang.String getName()
public void setGRuleList(List<GRule> list)
list - The new list node to be used as the GRule list.public int getNumGRule()
public int getNumGRuleNoTransform()
public GRule getGRule(int i)
i in the GRule list.i - Index of the element to return.i in the GRule list.public boolean hasGRule()
true if it has at least one child, false otherwise.public void addGRule(GRule node)
node - The element to append to the GRule list.public void addGRuleNoTransform(GRule node)
public void setGRule(GRule node, int i)
i with the new node node.node - The new node to replace the old list element.i - The list index of the node to be replaced.@ASTNodeAnnotation.ListChild(name="GRule") public List<GRule> getGRuleList()
public List<GRule> getGRuleListNoTransform()
This method does not invoke AST transformations.
public GRule getGRuleNoTransform(int i)
i in the GRule list without
triggering rewrites.public List<GRule> getGRules()