-
Notifications
You must be signed in to change notification settings - Fork 1
Home
kareman edited this page Aug 13, 2020
·
9 revisions
- Line: Matches one line, not including newline characters.
- Line.Start: Matches the start of a line, including the start of input.
- Line.End: Matches the end of a line, including the end of input.
- Literal: Matches a sequence of elements.
- OneOf: Matches and consumes a single element.
- Word
- Word.Boundary: Detects boundaries between words.
- Parser.Match.MatchDecoder
- Grammar: Allows for recursive patterns, also indirectly.
- Grammar.CallPattern: Calls another subpattern in a grammar.
-
AndPattern:
A pattern which matches the
wrapped
pattern, without consuming any input. - AnyPattern: A type erased wrapper around a pattern. Can be used to store patterns in arrays and non-generic variables.
- AnyPattern.StringInterpolation
- Capture: Captures the current position as a range.
- NoPattern: A pattern that does absolutely nothing.
-
OrPattern:
A pattern which first tries the
first
pattern, if that fails it tries thesecond
pattern from the same position. -
Concat:
A pattern which first tries the
first
pattern, if that succeeds it continues with thesecond
pattern. -
NotPattern:
A pattern which only succeeds if the
wrapped
pattern fails. The next pattern will continue from wherewrapped
started. -
RepeatPattern:
Repeats the
wrapped
patternmin
times, then repeats it optionallymax-min
times. Or an unlimited number of times if max is nil. - Skip: Skips 0 or more elements until a match for the next patterns are found.
- Parser: Takes a pattern, optimises it and tries to match it over an input.
- Parser.PatternError: Indicates a problem with a malformed pattern.
- Parser.Match: Contains information about a patterns successfully completed match.
-
Instruction:
The instructions used by patterns in
createInstructions
.
- CharacterLike
-
OneOfConvertible:
A type that
OneOf
can use. - Pattern: Something that can create Instructions for the Parser.
- RegexConvertible: A pattern that can be converted to regex.
- •(lhs:rhs:)
- •(lhs:rhs:)
- •(lhs:rhs:)
- •(lhs:rhs:)
- /(lhs:rhs:)
- /(lhs:rhs:)
-
<-(call:pattern:):
Used by grammars to define subpatterns with
g.a <- ...
. -
<-(call:capture:):
In case of
g.name <- Capture(...)
, names the nameless Capture "name". - /(p1:p2:): First tries the pattern to the left, if that fails it tries the pattern to the right from the same position.
- /(p1:p2:): First tries the pattern to the left, if that fails it tries the pattern to the right from the same position.
- /(p1:p2:): First tries the pattern to the left, if that fails it tries the pattern to the right from the same position.
- /(p1:p2:): First tries the pattern to the left, if that fails it tries the pattern to the right from the same position.
- /(p1:p2:): First tries the pattern to the left, if that fails it tries the pattern to the right from the same position.
- •(lhs:rhs:): First tries the pattern to the left, if that succeeds it tries the pattern to the right.
- •(lhs:rhs:): First tries the pattern to the left, if that succeeds it tries the pattern to the right.
- •(lhs:rhs:): First tries the pattern to the left, if that succeeds it tries the pattern to the right.
- •(lhs:rhs:): First tries the pattern to the left, if that succeeds it tries the pattern to the right.
- !(pattern:): Will only succeed if the following pattern fails. Does not consume any input.
- !(pattern:): Will only succeed if the following pattern fails. Does not consume any input.
- *(me:): Repeats the preceding pattern 0 or more times.
- *(me:): Repeats the preceding pattern 0 or more times.
- +(me:): Repeats the preceding pattern 1 or more times.
- +(me:): Repeats the preceding pattern 1 or more times.
- ¿(me:): Tries the preceding pattern, and continues even if it fails.
- ¿(me:): Tries the preceding pattern, and continues even if it fails.
- any: Succeeds anywhere except for at the end of input, and consumes 1 element.
-
letter:
Matches one character representing a letter, i.e. where
Character.isLetter
istrue
. -
lowercase:
Matches one character representing a lowercase character, i.e. where
Character.isLowercase
istrue
. -
uppercase:
Matches one character representing an uppercase character, i.e. where
Character.isUppercase
istrue
. -
digit:
Matches one character representing a whole number, i.e. where
Character.isWholeNumber
istrue
. - alphanumeric: Matches one letter or one digit.
-
newline:
Matches one character representing a newline, i.e. where
Character.isNewline
istrue
. -
whitespace:
Matches one character representing whitespace (including newlines), i.e. where
Character.isWhitespace
istrue
. -
punctuation:
Matches one character representing punctuation, i.e. where
Character.isPunctuation
istrue
. -
symbol:
Matches one character representing a symbol, i.e. where
Character.isSymbol
istrue
. -
hexDigit:
Matches one character representing a hexadecimal digit, i.e. where
Character.isHexDigit
istrue
. -
ascii:
Matches one ASCII character, i.e. where
Character.isASCII
istrue
. -
mathSymbol:
Matches one character representing a mathematical symbol, i.e. where
Character.isMathSymbol
istrue
. -
currencySymbol:
Matches one character representing a currency symbol, i.e. where
Character.isCurrencySymbol
istrue
.
Generated at 2020-08-23T12:56:49+0000 using swift-doc 1.0.0-beta.3.