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

PerCederberg.Grammatica.Runtime
Class ProductionPatternElement

System.Object
   |
   +--ProductionPatternElement

   in ProductionPatternElement.cs

public class ProductionPatternElement
extends System.Object

A production pattern element. This class represents a reference to either a token or a production. Each element also contains minimum and maximum occurence counters, controlling the number of repetitions allowed. A production pattern element is always contained within a production pattern rule.


Field Summary
 int Id
          The node identity property (read-only).
 internal LookAheadSet LookAhead
          The look-ahead set property.
 int MaxCount
          The maximum occurence count property (read-only).
 int MinCount
          The minimum occurence count property (read-only).
 
Constructor Summary
ProductionPatternElement( bool isToken, int id, int min, int max )
          Creates a new element.
 
Method Summary
 override bool Equals( object obj )
          Checks if this object is equal to another.
 override int GetHashCode()
          Returns a hash code for this object.
 int GetId()
          Deprecated. Use the Id property instead.
 int GetMaxCount()
          Deprecated. Use the MaxCount property instead.
 int GetMinCount()
          Deprecated. Use the MinCount property instead.
 bool IsMatch( Token token )
          Checks if a specific token matches this element.
 bool IsProduction()
          Returns true if this element represents a production.
 bool IsToken()
          Returns true if this element represents a token.
 override string ToString()
          Returns a string representation of this object.
 

Field Detail

Id

public int Id;
The node identity property (read-only).
Since:
1.5

LookAhead

 internal LookAheadSet LookAhead;
The look-ahead set property. This is the look-ahead set associated with this alternative.

MaxCount

public int MaxCount;
The maximum occurence count property (read-only).
Since:
1.5

MinCount

public int MinCount;
The minimum occurence count property (read-only).
Since:
1.5


Constructor Detail

ProductionPatternElement

public ProductionPatternElement( bool isToken, int id, int min, int max );
Creates a new element. If the maximum value if zero (0) or negative, it will be set to Int32.MaxValue.
Parameters:
isToken - the token flag
id - the node identity
min - the minimum number of occurancies
max - the maximum number of occurancies, or negative for infinite


Method Detail

Equals

public override bool Equals( object obj );
Checks if this object is equal to another. This method only returns true for another identical production pattern element.
Parameters:
obj - the object to compare with
Returns:
true if the object is identical to this one, or false otherwise

GetHashCode

public override int GetHashCode();
Returns a hash code for this object.
Returns:
a hash code for this object

GetId

public int GetId();
Deprecated. Use the Id property instead.

Returns the node identity.

Returns:
the node identity
See Also:
Id

GetMaxCount

public int GetMaxCount();
Deprecated. Use the MaxCount property instead.

Returns the maximum occurence count.

Returns:
the maximum occurence count
See Also:
MaxCount

GetMinCount

public int GetMinCount();
Deprecated. Use the MinCount property instead.

Returns the minimum occurence count.

Returns:
the minimum occurence count
See Also:
MinCount

IsMatch

public bool IsMatch( Token token );
Checks if a specific token matches this element. This method will only return true if this element is a token element, and the token has the same id and this element.
Parameters:
token - the token to check
Returns:
true if the token matches this element, or false otherwise

IsProduction

public bool IsProduction();
Returns true if this element represents a production.
Returns:
true if the element is a production, or false otherwise

IsToken

public bool IsToken();
Returns true if this element represents a token.
Returns:
true if the element is a token, or false otherwise

ToString

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

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