Package org.codehaus.groovy.syntax
Class Reduction
java.lang.Object
org.codehaus.groovy.syntax.CSTNode
org.codehaus.groovy.syntax.Reduction
A syntax reduction, produced by the 
Parser.- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds an element to the node.Creates aReductionfrom this node.get(int index) Returns the specified element, or null.getRoot()Returns the root of the node, the Token that indicates its type.booleanReturns true if the node is a complete expression.booleanisEmpty()Returns true if the node is completely empty (no root, even).voidMarks the node a complete expression.static ReductionCreates a newReductionwithToken.NULLas its root.remove(int index) Removes a node from theReduction.Sets an element in at the specified index.intsize()Returns the number of elements in the node.Methods inherited from class org.codehaus.groovy.syntax.CSTNodeaddChildrenOf, canMean, children, get, getDescription, getMeaning, getMeaningAs, getRoot, getRootText, getStartColumn, getStartLine, getType, hasChildren, isA, isAllOf, isOneOf, setMeaning, toString, write, write
- 
Field Details- 
EMPTY
 
- 
- 
Constructor Details- 
ReductionInitializes theReductionwith the specified root.
 
- 
- 
Method Details- 
newContainerCreates a newReductionwithToken.NULLas its root.
- 
isEmptypublic boolean isEmpty()Returns true if the node is completely empty (no root, even).
- 
sizepublic int size()Returns the number of elements in the node.
- 
getReturns the specified element, or null.
- 
getRootReturns the root of the node, the Token that indicates its type. Returns null if there is no root (usually only if the node is a placeholder of some kind -- see isEmpty()).
- 
markAsExpressionpublic void markAsExpression()Marks the node a complete expression.- Overrides:
- markAsExpressionin class- CSTNode
 
- 
isAnExpressionpublic boolean isAnExpression()Returns true if the node is a complete expression.- Overrides:
- isAnExpressionin class- CSTNode
 
- 
addAdds an element to the node.
- 
setSets an element in at the specified index.
- 
removeRemoves a node from theReduction. You cannot remove the root node (index 0).
- 
asReductionCreates aReductionfrom this node. Returns self if the node is already aReduction.- Specified by:
- asReductionin class- CSTNode
 
 
-