CoreComponents 3.0.0
A Modern C++ Toolkit
|
Internal state. More...
#include <SyntaxDefinition>
Public Member Functions | |
State (const SyntaxRule *entry) | |
Initialize internal state. | |
Token | match (const String &text, long start=0) const |
Match this syntax definition against text starting at offset | |
Token | parse (const String &text, long offset=0) const |
Match this syntax definition against text starting at offset | |
Token | findIn (const String &text, long offset=0) const |
Find the next occurance of this pattern in text starting from offset. | |
List< String > | breakUp (const String &text) const |
Break up text into the non-matching parts. | |
![]() | |
State ()=default | |
Default constructor. | |
State (const State &) | |
Copy constructor. | |
virtual | ~State () |
Virtual destructor. | |
long | useCount () const |
Reference count. | |
const State & | operator= (const State &) const |
template<class T > | |
bool | is () const |
Check if this state is of type T. | |
template<class T > | |
T & | as () |
Statically cast this state to a different type T. | |
template<class T > | |
const T & | as () const |
Statically cast this state to a different type T. | |
Single Character Literals | |
using | Char = syntax::CharNode |
Match the next character by comparing for equality | |
using | Other = syntax::OtherNode |
Match the next character by comparing for inequality | |
using | Match = syntax::MatchNode |
Match the next character with a custom function | |
using | Any = syntax::AnyNode |
Match an arbitrary next character | |
using | Within = syntax::RangeNode |
Match the next character for lying in a given range | |
using | Outside = syntax::OutOfRangeNode |
Match the next character for not lying in a given range | |
using | OneOf = syntax::OneOfNode |
Match the next character against a set of characters | |
using | NoneOf = syntax::NoneOfNode |
Match the next character if it is not member of a set of characters | |
Multi-Character Literals | |
using | Literal = syntax::LiteralNode |
Match a case-sensitive multi-character literal | |
using | Casefree = syntax::CasefreeNode |
Match a case-insensitive multi-character literal | |
using | Keyword = syntax::KeywordNode |
Match the shortest matching keyword out of a set of keywords. | |
Structural Elements | |
using | Sequence = syntax::SequenceNode |
Match a series of sub-expressions in sequence. | |
using | Choice = syntax::ChoiceNode |
Try sub-expression choices until the first matches (without considering the rest of the expression). | |
using | LongestChoice = syntax::ChoiceNode |
Try all sub-expression choices and produce the longest match (without considering the rest of the expression). | |
using | Repeat = syntax::RepeatNode |
Repeatedly match a sub-expression. | |
using | Find = syntax::FindNode |
Find the next text position at which the given sub-expression matches. | |
using | FindLast = syntax::FindLastNode |
Find the last text position at which the given sub-expression matches. | |
using | Ahead = syntax::AheadNode |
Match a given sub-expression ahead of the current text position. | |
using | Behind = syntax::BehindNode |
Match a given sub-expression behind the current text position. | |
using | Not = syntax::NotNode |
Do not match a given sub-expression ahead of the current text position. | |
using | NotBehind = syntax::NotBehindNode |
Match a given sub-expression not behind the current text position. | |
using | Ref = syntax::RefNode |
Bind a reference to another syntax rule. | |
using | Inline = syntax::InlineNode |
Bind a reference to another syntax rule (inline mode) | |
Constraints | |
using | Boi = syntax::BoiNode |
Match the start of information (current text position equals 0). | |
using | Eoi = syntax::EoiNode |
Match the end of the text (current text position equals length of text). | |
using | Length = syntax::LengthNode |
Enforce a required minimum and maximum text length when matching a sub-expression. | |
using | Pass = syntax::PassNode |
Unconditionally succeed to match at the current text position. | |
using | Fail = syntax::FailNode |
Unconditionally fail to match at the current text position. | |
using | Expect = syntax::ExpectNode |
Throw an expection if a sub-expression match fails. | |
Context Awareness | |
using | Capture = syntax::CaptureNode |
Match a sub-expression and copy the matching sequence | |
using | Replay = syntax::ReplayNode |
Match a previously captured text | |
using | Context = syntax::ContextNode |
Select a rule to match depending on production context. | |
using | Debug = syntax::DebugNode |
Show debugging information for a sub-expression match. | |
Internal state.
using Char = syntax::CharNode |
Match the next character by comparing for equality
using Other = syntax::OtherNode |
Match the next character by comparing for inequality
using Match = syntax::MatchNode |
Match the next character with a custom function
using Any = syntax::AnyNode |
Match an arbitrary next character
using Within = syntax::RangeNode |
Match the next character for lying in a given range
using Outside = syntax::OutOfRangeNode |
Match the next character for not lying in a given range
using OneOf = syntax::OneOfNode |
Match the next character against a set of characters
using NoneOf = syntax::NoneOfNode |
Match the next character if it is not member of a set of characters
using Literal = syntax::LiteralNode |
Match a case-sensitive multi-character literal
using Casefree = syntax::CasefreeNode |
Match a case-insensitive multi-character literal
using Keyword = syntax::KeywordNode |
Match the shortest matching keyword out of a set of keywords.
using Sequence = syntax::SequenceNode |
Match a series of sub-expressions in sequence.
using Choice = syntax::ChoiceNode |
Try sub-expression choices until the first matches (without considering the rest of the expression).
using LongestChoice = syntax::ChoiceNode |
Try all sub-expression choices and produce the longest match (without considering the rest of the expression).
using Repeat = syntax::RepeatNode |
Repeatedly match a sub-expression.
using Find = syntax::FindNode |
Find the next text position at which the given sub-expression matches.
using FindLast = syntax::FindLastNode |
Find the last text position at which the given sub-expression matches.
using Ahead = syntax::AheadNode |
Match a given sub-expression ahead of the current text position.
using Behind = syntax::BehindNode |
Match a given sub-expression behind the current text position.
using Not = syntax::NotNode |
Do not match a given sub-expression ahead of the current text position.
using NotBehind = syntax::NotBehindNode |
Match a given sub-expression not behind the current text position.
using Ref = syntax::RefNode |
Bind a reference to another syntax rule.
using Inline = syntax::InlineNode |
Bind a reference to another syntax rule (inline mode)
using Boi = syntax::BoiNode |
Match the start of information (current text position equals 0).
using Eoi = syntax::EoiNode |
Match the end of the text (current text position equals length of text).
using Length = syntax::LengthNode |
Enforce a required minimum and maximum text length when matching a sub-expression.
using Pass = syntax::PassNode |
Unconditionally succeed to match at the current text position.
using Fail = syntax::FailNode |
Unconditionally fail to match at the current text position.
using Expect = syntax::ExpectNode |
Throw an expection if a sub-expression match fails.
using Capture = syntax::CaptureNode |
Match a sub-expression and copy the matching sequence
using Replay = syntax::ReplayNode |
Match a previously captured text
using Context = syntax::ContextNode |
Select a rule to match depending on production context.
using Debug = syntax::DebugNode |
Show debugging information for a sub-expression match.
|
explicit |
Initialize internal state.
entry | Entry point for syntax production |
Match this syntax definition against text starting at offset
Match this syntax definition against text starting at offset
TextError | Text does not match this syntax definition |
Find the next occurance of this pattern in text starting from offset.