Grammatica
Public Member Functions | Properties | List of all members
PerCederberg.Grammatica.Runtime.Production Class Reference

A production node. More...

Inheritance diagram for PerCederberg.Grammatica.Runtime.Production:
PerCederberg.Grammatica.Runtime.Node

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...
 

Detailed Description

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).

Author
Per Cederberg
Version
1.5

Constructor & Destructor Documentation

PerCederberg.Grammatica.Runtime.Production.Production ( ProductionPattern  pattern)
inline

Creates a new production node.

Parameters
patternthe production pattern

Member Function Documentation

void PerCederberg.Grammatica.Runtime.Production.AddChild ( Node  child)
inline

Adds a child node.

The node will be added last in the list of children.

Parameters
childthe child node to add
ProductionPattern PerCederberg.Grammatica.Runtime.Production.GetPattern ( )
inline

Returns the production pattern for this production.

Returns
the production pattern
See also
Pattern
Deprecated:
Use the Pattern property instead.
override string PerCederberg.Grammatica.Runtime.Production.ToString ( )
inline

Returns a string representation of this production.

Returns
a string representation of this production

Property Documentation

override int PerCederberg.Grammatica.Runtime.Production.Count
get

The child node count property (read-only).

Since
1.5
override int PerCederberg.Grammatica.Runtime.Production.Id
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.

Since
1.5
override string PerCederberg.Grammatica.Runtime.Production.Name
get

The node name property (read-only).

Since
1.5
ProductionPattern PerCederberg.Grammatica.Runtime.Production.Pattern
get

The production pattern property (read-only).

This property contains the production pattern linked to this production.

Since
1.5
override Node PerCederberg.Grammatica.Runtime.Production.this[int index]
get

The child node index (read-only).

Parameters
indexthe child index, 0 <= index < Count
Returns
the child node found, or null if index out of bounds
Since
1.5

The documentation for this class was generated from the following file: