Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

PerCederberg.Grammatica.Runtime
Class Production

System.Object
   |
   +--Node
         |
         +--Production

   in Production.cs

public class Production
extends Node

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


Field Summary
 override int Count
          The child node count property (read-only).
 override int Id
          The node type id property (read-only).
 override string Name
          The node name property (read-only).
 ProductionPattern Pattern
          The production pattern property (read-only).
 override Node[ int index ] this
          The child node index (read-only).
   
Fields inherited from class Node
Id, Name, StartLine, StartColumn, EndLine, EndColumn, Parent, Count, this, Values
 
Constructor Summary
Production( ProductionPattern pattern )
          Creates a new production node.
 
Method Summary
 void AddChild( Node child )
          Adds a child node.
 ProductionPattern GetPattern()
          Deprecated. Use the Pattern property instead.
 internal override bool IsHidden()
          Checks if this node is hidden, i.
 override string ToString()
          Returns a string representation of this production.
   
Methods inherited from class Node
IsHidden, GetId, GetName, GetStartLine, GetStartColumn, GetEndLine, GetEndColumn, GetParent, SetParent, GetChildCount, GetDescendantCount, GetChildAt, GetValueCount, GetValue, GetAllValues, AddValue, AddValues, RemoveAllValues, PrintTo
 

Field Detail

Count

public override int Count;
The child node count property (read-only).
Since:
1.5

Id

public override int Id;
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

Name

public override string Name;
The node name property (read-only).
Since:
1.5

Pattern

public ProductionPattern Pattern;
The production pattern property (read-only). This property contains the production pattern linked to this production.
Since:
1.5

this

public override Node this[ int index ];
The child node index (read-only).
Parameters:
index - the child index, 0 <= index < Count
Returns:
the child node found, or null if index out of bounds
Since:
1.5


Constructor Detail

Production

public Production( ProductionPattern pattern );
Creates a new production node.
Parameters:
pattern - the production pattern


Method Detail

AddChild

public void AddChild( Node child );
Adds a child node. The node will be added last in the list of children.
Parameters:
child - the child node to add

GetPattern

public ProductionPattern GetPattern();
Deprecated. Use the Pattern property instead.

Returns the production pattern for this production.

Returns:
the production pattern
See Also:
Pattern

IsHidden

 internal override bool IsHidden();
Checks if this node is hidden, i.e. if it should not be visible outside the parser.
Returns:
true if the node should be hidden, or false otherwise

ToString

public override string ToString();
Returns a string representation of this production.
Returns:
a string representation of this production

 Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD