|
Doxygen
|
Class representing a token in the compiled regular expression token stream. 更多...
Public 类型 | |
| enum | Kind : uint16_t { Kind::End = 0x0000, Kind::WhiteSpace = 0x1001, Kind::Digit = 0x1002, Kind::Alpha = 0x1003, Kind::AlphaNum = 0x1004, Kind::CharClass = 0x2001, Kind::NegCharClass = 0x2002, Kind::BeginOfLine = 0x4001, Kind::EndOfLine = 0x4002, Kind::BeginOfWord = 0x4003, Kind::EndOfWord = 0x4004, Kind::BeginCapture = 0x4005, Kind::EndCapture = 0x4006, Kind::Any = 0x4007, Kind::Star = 0x4008, Kind::Optional = 0x4009, Kind::Character = 0x8000 } |
| The kind of token. 更多... | |
Public 成员函数 | |
| const char * | kindStr () const |
| returns a string representation of the tokens kind (useful for debugging). 更多... | |
| PToken () | |
| Creates a token of kind 'End' 更多... | |
| PToken (Kind k) | |
| Creates a token of the given kind k 更多... | |
| PToken (char c) | |
| Create a token for an ASCII character 更多... | |
| PToken (uint16_t v) | |
| Create a token for a byte of an UTF-8 character 更多... | |
| PToken (uint16_t from, uint16_t to) | |
| Create a token representing a range from one character from to another character to 更多... | |
| void | setValue (uint16_t value) |
| Sets the value for a token 更多... | |
| Kind | kind () const |
| Returns the kind of the token 更多... | |
| uint16_t | from () const |
| Returns the 'from' part of the character range. 更多... | |
| uint16_t | to () const |
| Returns the 'to' part of the character range. 更多... | |
| uint16_t | value () const |
| Returns the value for this token 更多... | |
| char | asciiValue () const |
| Returns the value for this token as a ASCII character 更多... | |
| bool | isRange () const |
| Returns true iff this token represents a range of characters 更多... | |
| bool | isCharClass () const |
| Returns true iff this token is a positive or negative character class 更多... | |
Private 属性 | |
| uint32_t | m_rep |
Class representing a token in the compiled regular expression token stream.
A token has a kind and an optional value whose meaning depends on the kind. It is also possible to store a (from,to) character range in a token.
|
strong |
The kind of token.
Ranges per bit mask:
0x00FF from part of a range, except for 0x0000 which is the End marker0x1FFF built-in ranges0x2FFF user defined ranges0x4FFF special operations0x8000 literal character | 枚举值 | |
|---|---|
| End | |
| WhiteSpace | |
| Digit | |
| Alpha | |
| AlphaNum | |
| CharClass | |
| NegCharClass | |
| BeginOfLine | |
| EndOfLine | |
| BeginOfWord | |
| EndOfWord | |
| BeginCapture | |
| EndCapture | |
| Any | |
| Star | |
| Optional | |
| Character | |
|
inline |
|
inlineexplicit |
|
inline |
Create a token for an ASCII character
|
inline |
Create a token for a byte of an UTF-8 character
|
inline |
|
inline |
Returns the value for this token as a ASCII character
引用了 m_rep.
被这些函数引用 reg::Ex::Private::compile(), reg::Ex::match() , 以及 reg::Ex::Private::matchAt().
|
inline |
|
inline |
Returns true iff this token is a positive or negative character class
引用了 CharClass, kind() , 以及 NegCharClass.
被这些函数引用 reg::Ex::Private::matchAt().
|
inline |
|
inline |
Returns the kind of the token
引用了 m_rep.
被这些函数引用 reg::Ex::Private::compile(), isCharClass(), reg::Ex::match() , 以及 reg::Ex::Private::matchAt().
|
inline |
returns a string representation of the tokens kind (useful for debugging).
引用了 Alpha, AlphaNum, Any, BeginCapture, BeginOfLine, BeginOfWord, Character, CharClass, Digit, End, EndCapture, EndOfLine, EndOfWord, m_rep, NegCharClass, Optional, Star , 以及 WhiteSpace.
|
inline |
|
inline |
|
inline |
Returns the value for this token
引用了 m_rep.
被这些函数引用 reg::Ex::Private::compile(), reg::Ex::Private::matchAt() , 以及 setValue().
|
private |
被这些函数引用 asciiValue(), from(), isRange(), kind(), kindStr(), setValue(), to() , 以及 value().