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

PerCederberg.Grammatica.Parser
Class Production

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

   in Production.cs

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


Constructor Summary
Production( ProductionPattern pattern )
          Creates a new production node.
 
Method Summary
 void AddChild( Node child )
          Adds a child node.
 override Node GetChildAt( int index )
          Returns the child node with the specified index.
 override int GetChildCount()
          Returns the number of child nodes.
 override int GetId()
          Returns the production (pattern) id.
 override string GetName()
          Returns the production node name.
 ProductionPattern GetPattern()
          Returns the production pattern for this production.
 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, GetChildAt, GetDescendantCount, GetValueCount, GetValue, GetAllValues, AddValue, AddValues, RemoveAllValues, PrintTo
 

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

GetChildAt

public override Node GetChildAt( int index );
Returns the child node with the specified index.
Parameters:
index - the child index, 0 <= index < count
Returns:
the child node found, or null if index out of bounds

GetChildCount

public override int GetChildCount();
Returns the number of child nodes.
Returns:
the number of child nodes

GetId

public override int GetId();
Returns the production (pattern) id. This value is set as a unique identifier when creating the production pattern to simplify later identification.
Returns:
the production id

GetName

public override string GetName();
Returns the production node name.
Returns:
the production node name

GetPattern

public ProductionPattern GetPattern();
Returns the production pattern for this production.
Returns:
the production 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.3 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD