Internal state.
More...
#include <SyntaxDefinition>
|
| | 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.
|
| |
◆ Char
Match the next character by comparing for equality
◆ Other
Match the next character by comparing for inequality
◆ Match
Match the next character with a custom function
◆ Any
Match an arbitrary next character
◆ Within
Match the next character for lying in a given range
◆ Outside
Match the next character for not lying in a given range
◆ OneOf
Match the next character against a set of characters
◆ NoneOf
Match the next character if it is not member of a set of characters
◆ Literal
Match a case-sensitive multi-character literal
◆ Casefree
Match a case-insensitive multi-character literal
◆ Keyword
Match the shortest matching keyword out of a set of keywords.
◆ Sequence
Match a series of sub-expressions in sequence.
◆ Choice
Try sub-expression choices until the first matches (without considering the rest of the expression).
◆ LongestChoice
Try all sub-expression choices and produce the longest match (without considering the rest of the expression).
◆ Repeat
Repeatedly match a sub-expression.
◆ Find
Find the next text position at which the given sub-expression matches.
◆ FindLast
Find the last text position at which the given sub-expression matches.
◆ Ahead
Match a given sub-expression ahead of the current text position.
◆ Behind
Match a given sub-expression behind the current text position.
◆ Not
Do not match a given sub-expression ahead of the current text position.
◆ NotBehind
Match a given sub-expression not behind the current text position.
◆ Ref
Bind a reference to another syntax rule.
◆ Inline
Bind a reference to another syntax rule (inline mode)
◆ Boi
Match the start of information (current text position equals 0).
◆ Eoi
Match the end of the text (current text position equals length of text).
◆ Length
Enforce a required minimum and maximum text length when matching a sub-expression.
◆ Pass
Unconditionally succeed to match at the current text position.
◆ Fail
Unconditionally fail to match at the current text position.
◆ Expect
Throw an expection if a sub-expression match fails.
◆ Capture
Match a sub-expression and copy the matching sequence
◆ Replay
Match a previously captured text
◆ Context
Select a rule to match depending on production context.
◆ Debug
Show debugging information for a sub-expression match.
◆ State()
Initialize internal state.
- Parameters
-
| entry | Entry point for syntax production |
◆ match()
| Token match |
( |
const String & | text, |
|
|
long | start = 0 ) const |
Match this syntax definition against text starting at offset
- Returns
- Root node of the syntax production tree
◆ parse()
| Token parse |
( |
const String & | text, |
|
|
long | offset = 0 ) const |
Match this syntax definition against text starting at offset
- Returns
- Root node of the syntax production tree
- Exceptions
-
| TextError | Text does not match this syntax definition |
◆ findIn()
| Token findIn |
( |
const String & | text, |
|
|
long | offset = 0 ) const |
Find the next occurance of this pattern in text starting from offset.
◆ breakUp()
Break up text into the non-matching parts.