RetroArch
|
Regular expression engine with subset of ECMAscript grammar. More...
#include <regex.h>
Classes | |
class | DecodedStream |
struct | Frag |
struct | Range |
struct | State |
Public Types | |
typedef Encoding::Ch | Ch |
Public Member Functions | |
GenericRegex (const Ch *source, Allocator *allocator=0) | |
~GenericRegex () | |
bool | IsValid () const |
template<typename InputStream > | |
bool | Match (InputStream &is) const |
bool | Match (const Ch *s) const |
template<typename InputStream > | |
bool | Search (InputStream &is) const |
bool | Search (const Ch *s) const |
Private Types | |
enum | Operator { kZeroOrOne, kZeroOrMore, kOneOrMore, kConcatenation, kAlternation, kLeftParenthesis } |
Private Member Functions | |
State & | GetState (SizeType index) |
const State & | GetState (SizeType index) const |
Range & | GetRange (SizeType index) |
const Range & | GetRange (SizeType index) const |
template<typename InputStream > | |
void | Parse (DecodedStream< InputStream > &ds) |
SizeType | NewState (SizeType out, SizeType out1, unsigned codepoint) |
void | PushOperand (Stack< Allocator > &operandStack, unsigned codepoint) |
void | ImplicitConcatenation (Stack< Allocator > &atomCountStack, Stack< Allocator > &operatorStack) |
SizeType | Append (SizeType l1, SizeType l2) |
void | Patch (SizeType l, SizeType s) |
bool | Eval (Stack< Allocator > &operandStack, Operator op) |
bool | EvalQuantifier (Stack< Allocator > &operandStack, unsigned n, unsigned m) |
void | CloneTopOperand (Stack< Allocator > &operandStack) |
template<typename InputStream > | |
bool | ParseUnsigned (DecodedStream< InputStream > &ds, unsigned *u) |
template<typename InputStream > | |
bool | ParseRange (DecodedStream< InputStream > &ds, SizeType *range) |
SizeType | NewRange (unsigned codepoint) |
template<typename InputStream > | |
bool | CharacterEscape (DecodedStream< InputStream > &ds, unsigned *escapedCodepoint) |
template<typename InputStream > | |
bool | SearchWithAnchoring (InputStream &is, bool anchorBegin, bool anchorEnd) const |
size_t | GetStateSetSize () const |
bool | AddState (Stack< Allocator > &l, SizeType index) const |
bool | MatchRange (SizeType rangeIndex, unsigned codepoint) const |
Static Private Member Functions | |
static SizeType | Min (SizeType a, SizeType b) |
Private Attributes | |
Stack< Allocator > | states_ |
Stack< Allocator > | ranges_ |
SizeType | root_ |
SizeType | stateCount_ |
SizeType | rangeCount_ |
uint32_t * | stateSet_ |
Stack< Allocator > | state0_ |
Stack< Allocator > | state1_ |
bool | anchorBegin_ |
bool | anchorEnd_ |
Static Private Attributes | |
static const unsigned | kAnyCharacterClass = 0xFFFFFFFF |
For '.'. More... | |
static const unsigned | kRangeCharacterClass = 0xFFFFFFFE |
static const unsigned | kRangeNegationFlag = 0x80000000 |
static const unsigned | kInfinityQuantifier = ~0u |
Regular expression engine with subset of ECMAscript grammar.
Supported regular expression syntax:
ab
Concatenationa|b
Alternationa
? Zero or onea*
Zero or morea+
One or morea{3}
Exactly 3 timesa{3
,} At least 3 timesa{3
,5} 3 to 5 times
(ab) Grouping^a
At the beginninga$
At the end
. Any character
[abc] Character classes
[a-c] Character class range
[a-z0-9_] Character class combination
[^abc] Negated character classes
[^a-c] Negated character class range
[] Backspace (U+0008)\
| \\ ... Escape characters\f
Form feed (U+000C)\n
Line feed (U+000A)\r
Carriage return (U+000D)\t
Tab (U+0009)\v
Vertical tab (U+000B)typedef Encoding::Ch internal::GenericRegex< Encoding, Allocator >::Ch |
|
private |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inlineprivate |
|
private |
|
private |
|
staticprivate |
For '.'.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |