![]() |
VR-Vantage 2.7 API Documentation
|
Regular expression engine with subset of ECMAscript grammar. More...
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 '.'. | |
| 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 |
|
inline |
|
inline |
|
inline |
|
inline |
References internal::GenericRegex< Encoding, Allocator >::anchorBegin_, internal::GenericRegex< Encoding, Allocator >::anchorEnd_, and internal::GenericRegex< Encoding, Allocator >::SearchWithAnchoring().
Referenced by internal::Schema< SchemaDocumentType >::IsPatternMatch(), and internal::GenericRegex< Encoding, Allocator >::Search().
|
inline |
|
inlineprivate |
References RAPIDJSON_ASSERT, internal::GenericRegex< Encoding, Allocator >::stateCount_, and internal::GenericRegex< Encoding, Allocator >::states_.
Referenced by internal::GenericRegex< Encoding, Allocator >::AddState(), internal::GenericRegex< Encoding, Allocator >::Append(), internal::GenericRegex< Encoding, Allocator >::CloneTopOperand(), internal::GenericRegex< Encoding, Allocator >::Parse(), internal::GenericRegex< Encoding, Allocator >::Patch(), and internal::GenericRegex< Encoding, Allocator >::SearchWithAnchoring().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::anchorBegin_, internal::GenericRegex< Encoding, Allocator >::anchorEnd_, internal::GenericRegex< Encoding, Allocator >::CharacterEscape(), internal::GenericRegex< Encoding, Allocator >::State::codepoint, exprtk::details::numeric::constant::e, internal::Stack< Allocator >::Empty(), internal::GenericRegex< Encoding, Allocator >::Eval(), internal::GenericRegex< Encoding, Allocator >::EvalQuantifier(), internal::Stack< Allocator >::GetSize(), internal::GenericRegex< Encoding, Allocator >::GetState(), internal::GenericRegex< Encoding, Allocator >::GetStateSetSize(), internal::GenericRegex< Encoding, Allocator >::ImplicitConcatenation(), internal::GenericRegex< Encoding, Allocator >::kAlternation, internal::GenericRegex< Encoding, Allocator >::kAnyCharacterClass, internal::GenericRegex< Encoding, Allocator >::kInfinityQuantifier, internal::GenericRegex< Encoding, Allocator >::kLeftParenthesis, internal::GenericRegex< Encoding, Allocator >::kOneOrMore, internal::GenericRegex< Encoding, Allocator >::kRangeCharacterClass, internal::kRegexInvalidState, internal::GenericRegex< Encoding, Allocator >::kZeroOrMore, internal::GenericRegex< Encoding, Allocator >::kZeroOrOne, internal::GenericRegex< Encoding, Allocator >::NewState(), internal::GenericRegex< Encoding, Allocator >::State::out, internal::GenericRegex< Encoding, Allocator >::Frag::out, internal::GenericRegex< Encoding, Allocator >::State::out1, internal::GenericRegex< Encoding, Allocator >::ParseRange(), internal::GenericRegex< Encoding, Allocator >::ParseUnsigned(), internal::GenericRegex< Encoding, Allocator >::Patch(), internal::GenericRegex< Encoding, Allocator >::DecodedStream< SourceStream >::Peek(), internal::GenericRegex< Encoding, Allocator >::PushOperand(), internal::GenericRegex< Encoding, Allocator >::State::rangeStart, RAPIDJSON_ASSERT, internal::GenericRegex< Encoding, Allocator >::root_, SizeType, internal::GenericRegex< Encoding, Allocator >::Frag::start, internal::GenericRegex< Encoding, Allocator >::state0_, internal::GenericRegex< Encoding, Allocator >::state1_, internal::GenericRegex< Encoding, Allocator >::stateCount_, internal::GenericRegex< Encoding, Allocator >::states_, internal::GenericRegex< Encoding, Allocator >::stateSet_, and internal::GenericRegex< Encoding, Allocator >::DecodedStream< SourceStream >::Take().
Referenced by internal::GenericRegex< Encoding, Allocator >::GenericRegex().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::State::codepoint, internal::kRegexInvalidRange, internal::GenericRegex< Encoding, Allocator >::State::out, internal::GenericRegex< Encoding, Allocator >::State::out1, internal::GenericRegex< Encoding, Allocator >::State::rangeStart, internal::GenericRegex< Encoding, Allocator >::stateCount_, and internal::GenericRegex< Encoding, Allocator >::states_.
Referenced by internal::GenericRegex< Encoding, Allocator >::Eval(), internal::GenericRegex< Encoding, Allocator >::Parse(), and internal::GenericRegex< Encoding, Allocator >::PushOperand().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::GetState(), internal::kRegexInvalidState, internal::GenericRegex< Encoding, Allocator >::State::out, and SizeType.
Referenced by internal::GenericRegex< Encoding, Allocator >::Eval(), and internal::GenericRegex< Encoding, Allocator >::Parse().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::Append(), exprtk::details::numeric::constant::e, internal::Stack< Allocator >::GetSize(), internal::GenericRegex< Encoding, Allocator >::kAlternation, internal::GenericRegex< Encoding, Allocator >::kConcatenation, internal::GenericRegex< Encoding, Allocator >::kOneOrMore, internal::kRegexInvalidState, internal::GenericRegex< Encoding, Allocator >::kZeroOrMore, internal::GenericRegex< Encoding, Allocator >::kZeroOrOne, internal::GenericRegex< Encoding, Allocator >::Min(), internal::GenericRegex< Encoding, Allocator >::Frag::minIndex, internal::GenericRegex< Encoding, Allocator >::NewState(), internal::GenericRegex< Encoding, Allocator >::Frag::out, internal::GenericRegex< Encoding, Allocator >::Patch(), RAPIDJSON_ASSERT, SizeType, and internal::GenericRegex< Encoding, Allocator >::Frag::start.
Referenced by internal::GenericRegex< Encoding, Allocator >::EvalQuantifier(), and internal::GenericRegex< Encoding, Allocator >::Parse().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::CloneTopOperand(), internal::GenericRegex< Encoding, Allocator >::Eval(), internal::Stack< Allocator >::GetSize(), internal::GenericRegex< Encoding, Allocator >::kConcatenation, internal::GenericRegex< Encoding, Allocator >::kInfinityQuantifier, internal::GenericRegex< Encoding, Allocator >::kOneOrMore, internal::GenericRegex< Encoding, Allocator >::kZeroOrMore, internal::GenericRegex< Encoding, Allocator >::kZeroOrOne, and RAPIDJSON_ASSERT.
Referenced by internal::GenericRegex< Encoding, Allocator >::Parse().
|
inlinestaticprivate |
Referenced by internal::GenericRegex< Encoding, Allocator >::Eval().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::GetState(), internal::kRegexInvalidState, internal::GenericRegex< Encoding, Allocator >::Frag::minIndex, internal::GenericRegex< Encoding, Allocator >::State::out, internal::GenericRegex< Encoding, Allocator >::Frag::out, internal::GenericRegex< Encoding, Allocator >::State::out1, SizeType, internal::GenericRegex< Encoding, Allocator >::Frag::start, internal::GenericRegex< Encoding, Allocator >::stateCount_, and internal::GenericRegex< Encoding, Allocator >::states_.
Referenced by internal::GenericRegex< Encoding, Allocator >::EvalQuantifier().
|
inlineprivate |
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::CharacterEscape(), internal::GenericRegex< Encoding, Allocator >::Range::end, internal::GenericRegex< Encoding, Allocator >::GetRange(), internal::GenericRegex< Encoding, Allocator >::kRangeNegationFlag, internal::kRegexInvalidRange, internal::GenericRegex< Encoding, Allocator >::NewRange(), internal::GenericRegex< Encoding, Allocator >::Range::next, internal::GenericRegex< Encoding, Allocator >::DecodedStream< SourceStream >::Peek(), RAPIDJSON_ASSERT, SizeType, internal::GenericRegex< Encoding, Allocator >::Range::start, and internal::GenericRegex< Encoding, Allocator >::DecodedStream< SourceStream >::Take().
Referenced by internal::GenericRegex< Encoding, Allocator >::Parse().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::Range::end, internal::kRegexInvalidRange, internal::GenericRegex< Encoding, Allocator >::Range::next, internal::GenericRegex< Encoding, Allocator >::rangeCount_, internal::GenericRegex< Encoding, Allocator >::ranges_, and internal::GenericRegex< Encoding, Allocator >::Range::start.
Referenced by internal::GenericRegex< Encoding, Allocator >::ParseRange().
|
inlineprivate |
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::AddState(), internal::GenericRegex< Encoding, Allocator >::State::codepoint, internal::Stack< Allocator >::Empty(), internal::GenericRegex< Encoding, Allocator >::GetState(), internal::GenericRegex< Encoding, Allocator >::GetStateSetSize(), internal::GenericRegex< Encoding, Allocator >::IsValid(), internal::GenericRegex< Encoding, Allocator >::kAnyCharacterClass, internal::GenericRegex< Encoding, Allocator >::kRangeCharacterClass, internal::GenericRegex< Encoding, Allocator >::MatchRange(), internal::GenericRegex< Encoding, Allocator >::State::out, internal::GenericRegex< Encoding, Allocator >::State::rangeStart, RAPIDJSON_ASSERT, internal::GenericRegex< Encoding, Allocator >::root_, SizeType, internal::GenericRegex< Encoding, Allocator >::state0_, internal::GenericRegex< Encoding, Allocator >::state1_, internal::GenericRegex< Encoding, Allocator >::stateSet_, internal::Swap(), and internal::GenericRegex< Encoding, Allocator >::DecodedStream< SourceStream >::Take().
Referenced by internal::GenericRegex< Encoding, Allocator >::Match(), and internal::GenericRegex< Encoding, Allocator >::Search().
|
inlineprivate |
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::GetState(), internal::kRegexInvalidState, internal::GenericRegex< Encoding, Allocator >::State::out, internal::GenericRegex< Encoding, Allocator >::State::out1, RAPIDJSON_ASSERT, and internal::GenericRegex< Encoding, Allocator >::stateSet_.
Referenced by internal::GenericRegex< Encoding, Allocator >::SearchWithAnchoring().
|
inlineprivate |
References internal::GenericRegex< Encoding, Allocator >::Range::end, internal::GenericRegex< Encoding, Allocator >::GetRange(), internal::GenericRegex< Encoding, Allocator >::kRangeNegationFlag, internal::kRegexInvalidRange, internal::GenericRegex< Encoding, Allocator >::Range::next, and internal::GenericRegex< Encoding, Allocator >::Range::start.
Referenced by internal::GenericRegex< Encoding, Allocator >::SearchWithAnchoring().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
Referenced by internal::GenericRegex< Encoding, Allocator >::CloneTopOperand(), internal::GenericRegex< Encoding, Allocator >::GetState(), internal::GenericRegex< Encoding, Allocator >::GetStateSetSize(), internal::GenericRegex< Encoding, Allocator >::NewState(), and internal::GenericRegex< Encoding, Allocator >::Parse().
|
private |
|
staticprivate |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |