public class GRule extends ASTNode<ASTNode> implements java.lang.Cloneable
children, generatedWithCacheCycle, numChildren, parent| Constructor and Description |
|---|
GRule() |
GRule(List<GComponent> p0,
Opt<GPrecedence> p1,
Opt<GAction> p2) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(GVisitor vis) |
void |
addGComponent(GComponent node)
Append an element to the GComponent list.
|
void |
addGComponentNoTransform(GComponent node) |
GRule |
clone() |
GRule |
copy() |
void |
flushAttrCache() |
void |
flushCollectionCache() |
GRule |
fullCopy()
Deprecated.
Please use treeCopy or treeCopyNoTransform instead
|
GAction |
getAction()
Retrieves the (optional) Action child.
|
Opt<GAction> |
getActionOpt()
Retrieves the optional node for the Action child.
|
Opt<GAction> |
getActionOptNoTransform()
Retrieves the optional node for child Action.
|
GComponent |
getGComponent(int i)
Retrieves the element at index
i in the GComponent list. |
List<GComponent> |
getGComponentList()
Retrieves the GComponent list.
|
List<GComponent> |
getGComponentListNoTransform()
Retrieves the GComponent list.
|
GComponent |
getGComponentNoTransform(int i) |
List<GComponent> |
getGComponents()
Retrieves the GComponent list.
|
List<GComponent> |
getGComponentsNoTransform()
Retrieves the GComponent list.
|
int |
getNumGComponent()
Retrieves the number of children in the GComponent list.
|
int |
getNumGComponentNoTransform()
Retrieves the number of children in the GComponent list.
|
GPrecedence |
getPrecedence()
Retrieves the (optional) Precedence child.
|
Opt<GPrecedence> |
getPrecedenceOpt()
Retrieves the optional node for the Precedence child.
|
Opt<GPrecedence> |
getPrecedenceOptNoTransform()
Retrieves the optional node for child Precedence.
|
boolean |
hasAction()
Check whether the optional Action child exists.
|
boolean |
hasGComponent()
Check whether the GComponent list has any children.
|
boolean |
hasPrecedence()
Check whether the optional Precedence child exists.
|
void |
init$Children()
Initializes the child array to the correct size.
|
protected boolean |
is$Equal(ASTNode node) |
protected int |
numChildren() |
void |
setAction(GAction node)
Replaces the (optional) Action child.
|
void |
setActionOpt(Opt<GAction> opt)
Replaces the optional node for the Action child.
|
void |
setGComponent(GComponent node,
int i)
Replaces the GComponent list element at index
i with the new node node. |
void |
setGComponentList(List<GComponent> list)
Replaces the GComponent list.
|
void |
setPrecedence(GPrecedence node)
Replaces the (optional) Precedence child.
|
void |
setPrecedenceOpt(Opt<GPrecedence> opt)
Replaces the optional node for the Precedence child.
|
GRule |
treeCopy()
Create a deep copy of the AST subtree at this node.
|
GRule |
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 GRule()
@ASTNodeAnnotation.Constructor(name={"GComponent","Precedence","Action"}, type={"List<GComponent>","Opt<GPrecedence>","Opt<GAction>"}, kind={"List","Opt","Opt"}) public GRule(List<GComponent> p0, Opt<GPrecedence> p1, Opt<GAction> p2)
public void init$Children()
init$Children in class ASTNode<ASTNode>protected int numChildren()
numChildren in class ASTNode<ASTNode>public void flushAttrCache()
flushAttrCache in class ASTNode<ASTNode>public void flushCollectionCache()
flushCollectionCache in class ASTNode<ASTNode>public GRule clone() throws java.lang.CloneNotSupportedException
@Deprecated public GRule fullCopy()
public GRule treeCopyNoTransform()
treeCopyNoTransform in class ASTNode<ASTNode>public GRule treeCopy()
public void setGComponentList(List<GComponent> list)
list - The new list node to be used as the GComponent list.public int getNumGComponent()
public int getNumGComponentNoTransform()
public GComponent getGComponent(int i)
i in the GComponent list.i - Index of the element to return.i in the GComponent list.public boolean hasGComponent()
true if it has at least one child, false otherwise.public void addGComponent(GComponent node)
node - The element to append to the GComponent list.public void addGComponentNoTransform(GComponent node)
public void setGComponent(GComponent 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="GComponent") public List<GComponent> getGComponentList()
public List<GComponent> getGComponentListNoTransform()
This method does not invoke AST transformations.
public GComponent getGComponentNoTransform(int i)
i in the GComponent list without
triggering rewrites.public List<GComponent> getGComponents()
public List<GComponent> getGComponentsNoTransform()
This method does not invoke AST transformations.
public void setPrecedenceOpt(Opt<GPrecedence> opt)
Opt
node containing the child Precedence, not the actual child!opt - The new node to be used as the optional node for the Precedence child.public void setPrecedence(GPrecedence node)
node - The new node to be used as the Precedence child.public boolean hasPrecedence()
true if the optional Precedence child exists, false if it does not.public GPrecedence getPrecedence()
null otherwise.@ASTNodeAnnotation.OptChild(name="Precedence") public Opt<GPrecedence> getPrecedenceOpt()
Opt node containing the child Precedence, not the actual child!public Opt<GPrecedence> getPrecedenceOptNoTransform()
Opt node containing the child Precedence, not the actual child!
This method does not invoke AST transformations.
public void setActionOpt(Opt<GAction> opt)
Opt
node containing the child Action, not the actual child!opt - The new node to be used as the optional node for the Action child.public void setAction(GAction node)
node - The new node to be used as the Action child.public boolean hasAction()
true if the optional Action child exists, false if it does not.public GAction getAction()
null otherwise.@ASTNodeAnnotation.OptChild(name="Action") public Opt<GAction> getActionOpt()
Opt node containing the child Action, not the actual child!