The PToken
Class Reference
Class representing a token in the compiled regular expression token stream. More...
Declaration
Enumerations Index
enum class | Kind : uint16_t { ... } |
The kind of token. More... | |
Public Constructors Index
PToken () | |
Creates a token of kind 'End'. More... | |
PToken (Kind k) | |
Creates a token of the given kind k. More... | |
PToken (char c) | |
Create a token for an ASCII character. More... | |
PToken (uint16_t v) | |
Create a token for a byte of an UTF-8 character. More... | |
PToken (uint16_t from, uint16_t to) | |
Create a token representing a range from one character from to another character to. More... | |
Public Member Functions Index
const char * | kindStr () const |
returns a string representation of the tokens kind (useful for debugging). More... | |
void | setValue (uint16_t value) |
Sets the value for a token. More... | |
Kind | kind () const |
Returns the kind of the token. More... | |
uint16_t | from () const |
Returns the 'from' part of the character range. More... | |
uint16_t | to () const |
Returns the 'to' part of the character range. More... | |
uint16_t | value () const |
Returns the value for this token. More... | |
char | asciiValue () const |
Returns the value for this token as a ASCII character. More... | |
bool | isRange () const |
Returns true iff this token represents a range of characters. More... | |
bool | isCharClass () const |
Returns true iff this token is a positive or negative character class. More... | |
Private Member Attributes Index
uint32_t | m_rep |
Description
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.
Definition at line 58 of file regex.cpp.
Enumerations
Kind
| strong |
The kind of token.
- Enumeration values
Ranges per bit mask:
- 255 from part of a range, except for 0 which is the End marker
- 8191 built-in ranges
- 12287 user defined ranges
- 20479 special operations
- 32768 literal character
Definition at line 70 of file regex.cpp.
Public Constructors
PToken()
| inline |
PToken()
| inline explicit |
PToken()
| inline |
PToken()
| inline |
PToken()
| inline |
Public Member Functions
asciiValue()
| inline |
Returns the value for this token as a ASCII character.
Definition at line 156 of file regex.cpp.
Reference m_rep.
Referenced by reg::Ex::Private::compile, reg::Ex::match and reg::Ex::Private::matchAt.
from()
| inline |
isCharClass()
| inline |
Returns true iff this token is a positive or negative character class.
Definition at line 162 of file regex.cpp.
References CharClass, kind and NegCharClass.
Referenced by reg::Ex::Private::matchAt.
isRange()
| inline |
kind()
| inline |
Returns the kind of the token.
Definition at line 144 of file regex.cpp.
Reference m_rep.
Referenced by reg::Ex::Private::compile, isCharClass, reg::Ex::match and reg::Ex::Private::matchAt.
kindStr()
| inline |
returns a string representation of the tokens kind (useful for debugging).
Definition at line 92 of file regex.cpp.
References Alpha, AlphaNum, Any, BeginCapture, BeginOfLine, BeginOfWord, Character, CharClass, Digit, End, EndCapture, EndOfLine, EndOfWord, m_rep, NegCharClass, Optional, Star and WhiteSpace.
Referenced by reg::Ex::Private::matchAt.
setValue()
| inline |
to()
| inline |
value()
| inline |
Returns the value for this token.
Definition at line 153 of file regex.cpp.
Reference m_rep.
Referenced by reg::Ex::Private::compile, reg::Ex::Private::matchAt and setValue.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus by Doxygen 1.14.0.