|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.syntax.CSTNode
org.codehaus.groovy.syntax.Reduction
public class Reduction
A syntax reduction, produced by the Parser
.
Parser
,
Token
,
CSTNode
,
Types
Field Summary | |
---|---|
static Reduction |
EMPTY
|
Constructor Summary | |
---|---|
Reduction(Token root)
Initializes the Reduction with the specified root. |
Method Summary | |
---|---|
CSTNode |
add(CSTNode element)
Adds an element to the node. |
Reduction |
asReduction()
Creates a Reduction from this node. |
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 Reduction with Token.NULL
as it's root. |
CSTNode |
remove(int index)
Removes a node from the Reduction . |
CSTNode |
set(int index,
CSTNode element)
Sets an element in at the specified index. |
int |
size()
Returns the number of elements in the node. |
Methods inherited from class org.codehaus.groovy.syntax.CSTNode |
---|
addChildrenOf, canMean, children, get, getDescription, getMeaning, getMeaningAs, getRoot, getRootText, getStartColumn, getStartLine, getType, hasChildren, isA, isAllOf, isOneOf, setMeaning, toString, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Reduction EMPTY
Constructor Detail |
---|
public Reduction(Token root)
Reduction
with the specified root.
Method Detail |
---|
public static Reduction newContainer()
Reduction
with Token.NULL
as it's root.
public boolean isEmpty()
isEmpty
in class CSTNode
public int size()
size
in class CSTNode
public CSTNode get(int index)
get
in class CSTNode
public Token getRoot()
getRoot
in class CSTNode
public void markAsExpression()
markAsExpression
in class CSTNode
public boolean isAnExpression()
isAnExpression
in class CSTNode
public CSTNode add(CSTNode element)
add
in class CSTNode
public CSTNode set(int index, CSTNode element)
set
in class CSTNode
public CSTNode remove(int index)
Reduction
. You cannot remove
the root node (index 0).
public Reduction asReduction()
Reduction
from this node. Returns self if the
node is already a Reduction
.
asReduction
in class CSTNode
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |