Grammatica
|
A production node. More...
Public Member Functions | |
Production (ProductionPattern pattern) | |
Creates a new production node. More... | |
void | AddChild (Node child) |
Adds a child node. More... | |
ProductionPattern | GetPattern () |
Returns the production pattern for this production. More... | |
override string | ToString () |
Returns a string representation of this production. More... | |
Public Member Functions inherited from PerCederberg.Grammatica.Runtime.Node | |
virtual int | GetId () |
Returns the node type id. More... | |
virtual string | GetName () |
Returns the node name. More... | |
virtual int | GetStartLine () |
The line number of the first character in this node. More... | |
virtual int | GetStartColumn () |
The column number of the first character in this node. More... | |
virtual int | GetEndLine () |
The line number of the last character in this node. More... | |
virtual int | GetEndColumn () |
The column number of the last character in this node. More... | |
Node | GetParent () |
Returns the parent node. More... | |
virtual int | GetChildCount () |
Returns the number of child nodes. More... | |
int | GetDescendantCount () |
Returns the number of descendant nodes. More... | |
virtual Node | GetChildAt (int index) |
Returns the child node with the specified index. More... | |
int | GetValueCount () |
Returns the number of computed values associated with this node. More... | |
object | GetValue (int pos) |
Returns a computed value of this node, if previously set. More... | |
ArrayList | GetAllValues () |
Returns the list with all the computed values for this node. More... | |
void | AddValue (object value) |
Adds a computed value to this node. More... | |
void | AddValues (ArrayList values) |
Adds a set of computed values to this node. More... | |
void | RemoveAllValues () |
Removes all computed values stored in this node. More... | |
void | PrintTo (TextWriter output) |
Prints this node and all subnodes to the specified output stream. More... | |
Properties | |
override int | Id [get] |
The node type id property (read-only). More... | |
override string | Name [get] |
The node name property (read-only). More... | |
override int | Count [get] |
The child node count property (read-only). More... | |
override Node | this[int index] [get] |
The child node index (read-only). More... | |
ProductionPattern | Pattern [get] |
The production pattern property (read-only). More... | |
Properties inherited from PerCederberg.Grammatica.Runtime.Node | |
abstract int | Id [get] |
The node type id property (read-only). More... | |
abstract string | Name [get] |
The node name property (read-only). More... | |
virtual int | StartLine [get] |
The line number property of the first character in this node (read-only). More... | |
virtual int | StartColumn [get] |
The column number property of the first character in this node (read-only). More... | |
virtual int | EndLine [get] |
The line number property of the last character in this node (read-only). More... | |
virtual int | EndColumn [get] |
The column number property of the last character in this node (read-only). More... | |
Node | Parent [get] |
The parent node property (read-only). More... | |
virtual int | Count [get] |
The child node count property (read-only). More... | |
virtual Node | this[int index] [get] |
The child node index (read-only). More... | |
ArrayList | Values [get, set] |
The node values property. More... | |
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).
|
inline |
Creates a new production node.
pattern | the production pattern |
|
inline |
Adds a child node.
The node will be added last in the list of children.
child | the child node to add |
|
inline |
Returns the production pattern for this production.
|
inline |
Returns a string representation of this production.
|
get |
The child node count property (read-only).
|
get |
The node type id property (read-only).
This value is set as a unique identifier for each type of node, in order to simplify later identification.
|
get |
The node name property (read-only).
|
get |
The production pattern property (read-only).
This property contains the production pattern linked to this production.
|
get |
The child node index (read-only).
index | the child index, 0 <= index < Count |