|
Grammatica 1.5 Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
System.Object
|
+--ProductionPatternAlternative
in ProductionPatternAlternative.csA production pattern alternative. This class represents a list of production pattern elements. In order to provide productions that cannot be represented with the element occurance counters, multiple alternatives must be created and added to the same production pattern. A production pattern alternative is always contained within a production pattern.
| Field Summary | |
int |
Count
The production pattern element count property (read-only). |
internal LookAheadSet |
LookAhead
The look-ahead set property. |
ProductionPattern |
Pattern
The production pattern property (read-only). |
ProductionPatternElement[ int index ] |
this
The production pattern element index (read-only). |
| Constructor Summary | |
ProductionPatternAlternative()
Creates a new production pattern alternative. |
|
| Method Summary | |
void |
AddElement( ProductionPatternElement elem )
Adds a production pattern element to this alternative. |
void |
AddElement( ProductionPatternElement elem, int min, int max )
Adds a production pattern element to this alternative. |
void |
AddProduction( int id, int min, int max )
Adds a production to this alternative. |
void |
AddToken( int id, int min, int max )
Adds a token to this alternative. |
override bool |
Equals( object obj )
Checks if this object is equal to another. |
bool |
Equals( ProductionPatternAlternative alt )
Checks if this alternative is equal to another. |
ProductionPatternElement |
GetElement( int pos )
Deprecated. Use the class indexer instead. |
int |
GetElementCount()
Deprecated. Use the Count property instead. |
override int |
GetHashCode()
Returns a hash code for this object. |
int |
GetMaxElementCount()
Returns the maximum number of elements needed to satisfy this alternative. |
int |
GetMinElementCount()
Returns the minimum number of elements needed to satisfy this alternative. |
ProductionPattern |
GetPattern()
Deprecated. Use the Pattern property instead. |
bool |
IsLeftRecursive()
Checks if this alternative is recursive on the left-hand side. |
bool |
IsMatchingEmpty()
Checks if this alternative would match an empty stream of tokens. |
bool |
IsRightRecursive()
Checks if this alternative is recursive on the right-hand side. |
internal void |
SetPattern( ProductionPattern pattern )
Changes the production pattern containing this alternative. |
override string |
ToString()
Returns a string representation of this object. |
| Field Detail |
public int Count;
internal LookAheadSet LookAhead;
public ProductionPattern Pattern;
public ProductionPatternElement this[ int index ];
index - the element index, 0 <= pos < Count| Constructor Detail |
public ProductionPatternAlternative();
| Method Detail |
public void AddElement( ProductionPatternElement elem );
elem - the production pattern elementpublic void AddElement( ProductionPatternElement elem, int min, int max );
elem - the production pattern element
min - the minimum number of occurancies
max - the maximum number of occurancies, or
-1 for infinitepublic void AddProduction( int id, int min, int max );
id - the production (pattern) id
min - the minimum number of occurancies
max - the maximum number of occurancies, or
-1 for infinitepublic void AddToken( int id, int min, int max );
id - the token (pattern) id
min - the minimum number of occurancies
max - the maximum number of occurancies, or
-1 for infinitepublic override bool Equals( object obj );
obj - the object to compare withpublic bool Equals( ProductionPatternAlternative alt );
alt - the alternative to compare withpublic ProductionPatternElement GetElement( int pos );
Returns an element in this alternative.
pos - the element position, 0 <= pos < countpublic int GetElementCount();
Returns the number of elements in this alternative.
Countpublic override int GetHashCode();
public int GetMaxElementCount();
public int GetMinElementCount();
public ProductionPattern GetPattern();
Returns the production pattern containing this alternative.
Patternpublic bool IsLeftRecursive();
public bool IsMatchingEmpty();
public bool IsRightRecursive();
internal void SetPattern( ProductionPattern pattern );
pattern - the new production patternpublic override string ToString();
|
Grammatica 1.5 Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||