Doxygen
|
Private members of a regular expression. More...
Public Member Functions | |
Private (std::string_view pat) | |
Creates the private part. | |
void | compile () |
Compiles a regular expression passed as a string into a stream of tokens that can be used for efficient searching. | |
bool | matchAt (size_t tokenPos, size_t tokenLen, std::string_view str, Match &match, size_t pos, int level) const |
Internal matching routine. | |
Public Attributes | |
bool | error = false |
Flag indicating the expression was successfully compiled. | |
std::vector< PToken > | data |
The token stream representing the compiled regular expression. | |
std::string | pattern |
The pattern string as passed by the user. | |
|
inline |
Creates the private part.
Definition at line 173 of file regex.cpp.
void reg::Ex::Private::compile | ( | ) |
Compiles a regular expression passed as a string into a stream of tokens that can be used for efficient searching.
Definition at line 197 of file regex.cpp.
References reg::PToken::Alpha, reg::PToken::AlphaNum, reg::PToken::Any, reg::PToken::asciiValue(), reg::PToken::BeginCapture, reg::PToken::BeginOfLine, reg::PToken::BeginOfWord, reg::PToken::Character, reg::PToken::CharClass, data, reg::PToken::Digit, reg::PToken::End, reg::PToken::EndCapture, reg::PToken::EndOfLine, reg::PToken::EndOfWord, error, reg::PToken::kind(), reg::PToken::NegCharClass, reg::PToken::Optional, pattern, reg::PToken::Star, reg::PToken::value(), and reg::PToken::WhiteSpace.
bool reg::Ex::Private::matchAt | ( | size_t | tokenPos, |
size_t | tokenLen, | ||
std::string_view | str, | ||
Match & | match, | ||
size_t | pos, | ||
int | level ) const |
Internal matching routine.
tokenPos | Offset into the token stream. |
tokenLen | The length of the token stream. |
str | The input string to match against. |
match | The object used to store the matching results. |
pos | The position in the input string to start with matching |
level | Recursion level (used for debugging) |
Definition at line 448 of file regex.cpp.
References reg::PToken::Alpha, reg::PToken::AlphaNum, reg::PToken::Any, reg::PToken::asciiValue(), reg::PToken::BeginCapture, reg::PToken::BeginOfLine, reg::PToken::BeginOfWord, reg::PToken::Character, data, DBG, reg::PToken::Digit, reg::PToken::EndCapture, reg::PToken::EndOfLine, reg::PToken::EndOfWord, found, reg::PToken::from(), reg::Match::init(), reg::isalnum(), reg::isalpha(), reg::PToken::isCharClass(), reg::isdigit(), isIdChar, reg::isspace(), reg::PToken::kind(), reg::PToken::kindStr(), reg::Match::length(), reg::Ex::match(), matchAt(), reg::PToken::NegCharClass, reg::PToken::Optional, reg::PToken::Star, reg::PToken::to(), reg::PToken::value(), and reg::PToken::WhiteSpace.
Referenced by matchAt().
std::vector<PToken> reg::Ex::Private::data |
bool reg::Ex::Private::error = false |
std::string reg::Ex::Private::pattern |