Grammatica
|
A production pattern. More...
Public Member Functions | |
ProductionPattern (int id, string name) | |
Creates a new production pattern. More... | |
int | GetId () |
Returns the unique production pattern identity value. More... | |
string | GetName () |
Returns the production pattern name. More... | |
bool | IsSyntetic () |
Checks if the synthetic production flag is set. More... | |
void | SetSyntetic (bool synthetic) |
Sets the synthetic production pattern flag. More... | |
int | GetAlternativeCount () |
Returns the number of alternatives in this pattern. More... | |
ProductionPatternAlternative | GetAlternative (int pos) |
Returns an alternative in this pattern. More... | |
bool | IsLeftRecursive () |
Checks if this pattern is recursive on the left-hand side. More... | |
bool | IsRightRecursive () |
Checks if this pattern is recursive on the right-hand side. More... | |
bool | IsMatchingEmpty () |
Checks if this pattern would match an empty stream of tokens. More... | |
void | AddAlternative (ProductionPatternAlternative alt) |
Adds a production pattern alternative. More... | |
override string | ToString () |
Returns a string representation of this object. More... | |
Properties | |
int | Id [get] |
The production pattern identity property (read-only). More... | |
string | Name [get] |
The production pattern name property (read-only). More... | |
bool | Synthetic [get, set] |
The synthetic production pattern property. More... | |
int | Count [get] |
The production pattern alternative count property (read-only). More... | |
ProductionPatternAlternative | this[int index] [get] |
The production pattern alternative index (read-only). More... | |
A production pattern.
This class represents a set of production alternatives that together forms a single production. A production pattern is identified by an integer id and a name, both provided upon creation. The pattern id is used for referencing the production pattern from production pattern elements.
|
inline |
Creates a new production pattern.
id | the production pattern id |
name | the production pattern name |
|
inline |
Adds a production pattern alternative.
alt | the production pattern alternative to add |
ParserCreationException | if an identical alternative has already been added |
|
inline |
Returns an alternative in this pattern.
pos | the alternative position, 0 <= pos < count |
|
inline |
Returns the number of alternatives in this pattern.
|
inline |
Returns the unique production pattern identity value.
|
inline |
Returns the production pattern name.
|
inline |
Checks if this pattern is recursive on the left-hand side.
This method checks if any of the production pattern alternatives is left-recursive.
|
inline |
Checks if this pattern would match an empty stream of tokens.
This method checks if any one of the production pattern alternatives would match the empty token stream.
|
inline |
Checks if this pattern is recursive on the right-hand side.
This method checks if any of the production pattern alternatives is right-recursive.
|
inline |
Checks if the synthetic production flag is set.
If this flag is set, the production identified by this pattern has been artificially inserted into the grammar. No parse tree nodes will be created for such nodes, instead the child nodes will be added directly to the parent node.
|
inline |
Sets the synthetic production pattern flag.
If this flag is set, the production identified by this pattern has been artificially inserted into the grammar. By default this flag is set to false.
syntetic | the new value of the synthetic flag |
|
inline |
Returns a string representation of this object.
|
get |
The production pattern alternative count property (read-only).
|
get |
The production pattern identity property (read-only).
This property contains the unique identity value.
|
get |
The production pattern name property (read-only).
|
getset |
The synthetic production pattern property.
If this property is set, the production identified by this pattern has been artificially inserted into the grammar. No parse tree nodes will be created for such nodes, instead the child nodes will be added directly to the parent node. By default this property is set to false.
|
get |
The production pattern alternative index (read-only).
index | the alternative index, 0 <= pos < Count |