|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.syntax.CSTNode org.codehaus.groovy.syntax.Reduction
public class Reduction extends CSTNode
A syntax reduction, produced by the Parser
.
Field Summary | |
---|---|
static Reduction |
EMPTY
|
Constructor Summary | |
Reduction(Token root)
Initializes the |
Method Summary | |
---|---|
CSTNode
|
add(CSTNode element)
Adds an element to the node. |
Reduction
|
asReduction()
|
CSTNode
|
get(int index)
Returns the specified element, or null. |
Token
|
getRoot()
Returns the root of the node, the Token that indicates it's type. |
boolean
|
isAnExpression()
Returns true if the node is a complete expression. |
boolean
|
isEmpty()
Returns true if the node is completely empty (no root, even). |
void
|
markAsExpression()
Marks the node a complete expression. |
static Reduction
|
newContainer()
Creates a new |
CSTNode
|
remove(int index)
Removes a node from the |
CSTNode
|
set(int index, CSTNode element)
|
int
|
size()
Returns the number of elements in the node. |
Methods inherited from class CSTNode | |
---|---|
add, addChildrenOf, asReduction, canMean, children, get, get, getDescription, getMeaning, getMeaningAs, getRoot, getRoot, getRootText, getStartColumn, getStartLine, getType, hasChildren, isA, isAllOf, isAnExpression, isEmpty, isOneOf, markAsExpression, set, setMeaning, size, toString, write, write |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final Reduction EMPTY
Constructor Detail |
---|
public Reduction(Token root)
Reduction
with the specified root.
Method Detail |
---|
public CSTNode add(CSTNode element)
public Reduction asReduction()
public CSTNode get(int index)
public Token getRoot()
public boolean isAnExpression()
public boolean isEmpty()
public void markAsExpression()
public static Reduction newContainer()
Reduction
with Token.NULL
as it's root.
public CSTNode remove(int index)
Reduction
. You cannot remove
the root node (index 0).
public CSTNode set(int index, CSTNode element)
public int size()
Copyright © 2003-2013 The Codehaus. All rights reserved.