#include <matcher.hh>
Public Methods | |
TMatcher (void) | |
Builds a new instance. | |
TMatcher (std::basic_istream< char > &rtISTREAM) | |
TMatcher (const std::string &rySTRING) | |
TMatcher (const char *pkcSTRING) | |
~TMatcher (void) | |
Destroys the instance. | |
void | clearDefinitions (void) |
Clears all terminal definitions. | |
void | define (const char *pkcTERMINAL, const char *pkcDEFINITION) |
void | redefine (const char *pkcTERMINAL, const char *pkcDEFINITION) |
void | setCaseSensitiveness (bool gTRUTH) |
void | setInput (const char *pkcSTRING) |
void | setInput (const std::string &rkySTRING) |
void | setInput (std::basic_istream< char > &rtISTREAM) |
size_t | scan (const char *pkcPATTERN_STRING...) const |
bool | match (const char *pkcPATTERN_STRING) const |
Protected Methods | |
void | clearStream (void) |
Clears the local stream (if any). | |
void | checkStream (void) const |
Checks if the input stream (if any) is re-positionable. | |
TString | instantiate (const char *pkcPATTERN_STRING) const |
bool | matchChars (char cSOURCE, const char *pkcPATTERN_STRING) const |
Recognized patterns:
[[:space:]]+ ::= {[[:space:]]} [[:space:]]* ::= [{[[:space:]]}] [[:space:]] ::= c / ( isspace (c) == true ) [[:blank:]]+ ::= {[[:blank:]]} [[:blank:]]* ::= [{[[:blank:]]}] [[:blank:]] ::= c / ( ( c == ' ' ) || ( c == '\t' ) ) [.]* ::= c* / text between tags c? ::= [c] d ::= d+ / ( isdigit (c) == true ) s ::= c+ / ( ( c == '_' ) || ( c == '-' ) || ( isalnum (c) == true ) ) q ::= "d+" | c+ / ( ( d != '"' ) && ( ( c == '_' ) || ( c == '-' ) || ( isalnum (c) == true ) ) t ::= c* / text between tags <<EOF>> ::= End of input
Definition at line 73 of file matcher.hh.
|
Builds a new instance.
Definition at line 108 of file matcher.hh. References checkStream(). |
|
Builds a new instance.
Definition at line 121 of file matcher.hh. References checkStream(). |
|
Builds a new instance.
Definition at line 137 of file matcher.hh. References checkStream(). |
|
Defines a terminal with name pkcTERMINAL, and definition pkcDEFINITION.
Definition at line 150 of file matcher.cc. |
|
Instantiates pattern pkcPATTERN_STRING with all terminals defined, so all the appearances of terminals defined are substituted by their definitions.
Definition at line 677 of file matcher.cc. References mpcl::text::TString. |
|
Matches the string at rtSOURCE, with pattern pkcPATTERN_STRING. If there is any argument in the pattern, then it is forgotten. The matched string is not removed.
Definition at line 160 of file matcher.cc. References scan(). |
|
Matches the character cSOURCE, with the first in pattern pkcPATTERN_STRING.
Definition at line 694 of file matcher.cc. |
|
Redefines a terminal with name pkcTERMINAL, and definition pkcDEFINITION.
Definition at line 191 of file matcher.cc. |
|
Matches the input string, using pattern pkcPATTERN_STRING. If there is any argument in the pattern, then it is written in each argument after pkcPATTERN_STRING. The matched string is removed from stream.
Definition at line 201 of file matcher.cc. References mpcl::text::TString. Referenced by match(). |
|
Sets case-sensitiveness state.
Definition at line 616 of file matcher.cc. |
|
Sets input stream.
Definition at line 640 of file matcher.cc. References checkStream(), and clearStream(). |
|
Sets input string.
Definition at line 190 of file matcher.hh. References setInput(). |
|
Sets input string.
Definition at line 625 of file matcher.cc. References checkStream(), and clearStream(). Referenced by setInput(). |