Grammatica
|
A token pattern. More...
Public Types | |
enum | PatternType { PatternType.STRING, PatternType.REGEXP } |
The pattern type enumeration. More... | |
Public Member Functions | |
TokenPattern (int id, string name, PatternType type, string pattern) | |
Creates a new token pattern. More... | |
int | GetId () |
Returns the unique token pattern identity value. More... | |
string | GetName () |
Returns the token pattern name. More... | |
PatternType | GetPatternType () |
Returns the token pattern type. More... | |
string | GetPattern () |
Returns te token pattern. More... | |
bool | IsError () |
Checks if the pattern corresponds to an error token. More... | |
string | GetErrorMessage () |
Returns the token error message if the pattern corresponds to an error token. More... | |
void | SetError () |
Sets the token error flag and assigns a default error message. More... | |
void | SetError (string message) |
Sets the token error flag and assigns the specified error message. More... | |
bool | IsIgnore () |
Checks if the pattern corresponds to an ignored token. More... | |
string | GetIgnoreMessage () |
Returns the token ignore message if the pattern corresponds to an ignored token. More... | |
void | SetIgnore () |
Sets the token ignore flag and clears the ignore message. More... | |
void | SetIgnore (string message) |
Sets the token ignore flag and assigns the specified ignore message. More... | |
override string | ToString () |
Returns a string representation of this object. More... | |
string | ToShortString () |
Returns a short string representation of this object. More... | |
Properties | |
int | Id [get] |
The token pattern identity property (read-only). More... | |
string | Name [get] |
The token pattern name property (read-only). More... | |
PatternType | Type [get] |
The token pattern type property (read-only). More... | |
string | Pattern [get] |
The token pattern property (read-only). More... | |
bool | Error [get, set] |
The error flag property. More... | |
string | ErrorMessage [get, set] |
The token error message property. More... | |
bool | Ignore [get, set] |
The ignore flag property. More... | |
string | IgnoreMessage [get, set] |
The token ignore message property. More... | |
string | DebugInfo [get, set] |
The token debug info message property. More... | |
A token pattern.
This class contains the definition of a token (i.e. it's pattern), and allows testing a string against this pattern. A token pattern is uniquely identified by an integer id, that must be provided upon creation.
|
inline |
Creates a new token pattern.
id | the token pattern id |
name | the token pattern name |
type | the token pattern type |
pattern | the token pattern |
|
inline |
Returns the token error message if the pattern corresponds to an error token.
|
inline |
Returns the unique token pattern identity value.
|
inline |
Returns the token ignore message if the pattern corresponds to an ignored token.
|
inline |
Returns the token pattern name.
|
inline |
Returns te token pattern.
|
inline |
Returns the token pattern type.
|
inline |
Checks if the pattern corresponds to an error token.
If this is true, it means that an error should be reported if a matching token is found.
|
inline |
Checks if the pattern corresponds to an ignored token.
If this is true, it means that the token should be ignored if found.
|
inline |
Sets the token error flag and assigns a default error message.
|
inline |
Sets the token error flag and assigns the specified error message.
message | the error message to display |
|
inline |
Sets the token ignore flag and clears the ignore message.
|
inline |
Sets the token ignore flag and assigns the specified ignore message.
message | the ignore message to display |
|
inline |
Returns a short string representation of this object.
|
inline |
Returns a string representation of this object.
|
getset |
The token debug info message property.
This is normally be set when the token pattern is analyzed by the tokenizer.
|
getset |
The error flag property.
If this property is true, the token pattern corresponds to an error token and an error should be reported if a match is found. When setting this property to true, a default error message is created if none was previously set.
|
getset |
The token error message property.
The error message is printed whenever the token is matched. Setting the error message property also sets the error flag to true.
|
get |
The token pattern identity property (read-only).
This property contains the unique token pattern identity value.
|
getset |
The ignore flag property.
If this property is true, the token pattern corresponds to an ignore token and should be skipped if a match is found.
|
getset |
The token ignore message property.
The ignore message is printed whenever the token is matched. Setting the ignore message property also sets the ignore flag to true.
|
get |
The token pattern name property (read-only).
|
get |
The token pattern property (read-only).
This property contains the actual pattern (string or regexp) which have to be matched.
|
get |
The token pattern type property (read-only).