|
Grammatica 1.3 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.
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 )
Returns an element in this alternative. |
int |
GetElementCount()
Returns the number of elements in this alternative. |
internal LookAheadSet |
GetLookAhead()
Returns the look-ahead set associated with this alternative. |
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()
Returns the production pattern containing this alternative. |
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 |
SetLookAhead( LookAheadSet lookAhead )
Sets the look-ahead set for this alternative. |
internal void |
SetPattern( ProductionPattern pattern )
Changes the production pattern containing this alternative. |
override string |
ToString()
Returns a string representation of this object. |
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 );
pos
- the element position, 0 <= pos < countpublic int GetElementCount();
internal LookAheadSet GetLookAhead();
public int GetMaxElementCount();
public int GetMinElementCount();
public ProductionPattern GetPattern();
public bool IsLeftRecursive();
public bool IsMatchingEmpty();
public bool IsRightRecursive();
internal void SetLookAhead( LookAheadSet lookAhead );
lookAhead
- the new look-ahead setinternal void SetPattern( ProductionPattern pattern );
pattern
- the new production patternpublic override string ToString();
|
Grammatica 1.3 Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |