|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.grammatica.parser.Node | +--net.percederberg.grammatica.parser.Production
A production node. This class represents a grammar production (i.e. a list of child nodes) in a parse tree. The productions are created by a parser, that adds children a according to a set of production patterns (i.e. grammar rules).
Constructor Summary | |
Production(ProductionPattern pattern)
Creates a new production node. |
Method Summary | |
void |
addChild(Node child)
Adds a child node. |
Node |
getChildAt(int index)
Returns the child node with the specified index. |
int |
getChildCount()
Returns the number of child nodes. |
int |
getId()
Returns the production (pattern) id. |
ProductionPattern |
getPattern()
Returns the production pattern for this production. |
java.lang.String |
toString()
Returns a string representation of this production. |
Methods inherited from class net.percederberg.grammatica.parser.Node |
addValue, addValues, getAllValues, getParent, getValue, getValueCount, printTo, printTo, removeAllValues |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Production(ProductionPattern pattern)
pattern
- the production patternMethod Detail |
public ProductionPattern getPattern()
public int getId()
getId
in class Node
public int getChildCount()
getChildCount
in class Node
public Node getChildAt(int index)
getChildAt
in class Node
index
- the child index, 0 <= index < count
public void addChild(Node child)
child
- the child node to addpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |