THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
The input this parser instance is running against.
Runs its inner rule but resets the parser (cursor and value stack) afterwards, succeeds only if its inner rule succeeded.
Runs its inner rule but resets the parser (cursor and value stack) afterwards, succeeds only if its inner rule succeeded.
Matches any character except EOI.
Matches any character except EOI.
Matches the EOI (end-of-input) character.
Matches the EOI (end-of-input) character.
Matches no character (i.e.
Matches no character (i.e. doesn't cause the parser to make any progress) but succeeds always (as a rule).
A generic Rule that always fails.
A generic Rule that always fails.
A Rule0 that always fails.
A Rule0 that always fails.
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
THIS IS NOT PUBLIC API and might become hidden in future.
THIS IS NOT PUBLIC API and might become hidden in future. Use only if you know what you are doing!
Matches any single one of the given characters.
Matches any single one of the given characters.
Note: This helper has O(n) runtime with n being the length of the given string. If your string consists only of 7-bit ASCII chars using a pre-allocated CharPredicate will be more efficient.
Marks a rule as "undividable" from an error reporting perspective.
Marks a rule as "undividable" from an error reporting perspective. The parser will never report errors *inside* of the marked rule. Rather, if the rule mismatches, the error will be reported at the very beginning of the attempted rule match.
Pushes the input text matched by its inner rule onto the value stack after its inner rule has been run successfully (and only then).
Pushes the input text matched by its inner rule onto the value stack after its inner rule has been run successfully (and only then).
Matches the given single character.
Matches the given single character.
Returns the character at the input index with the given delta to the cursor.
Returns the character at the input index with the given delta to the cursor. Note: for performance optimization this method does *not* do a range check, i.e. depending on the ParserInput implementation you might get an exception when calling this method before any character was matched by the parser.
Same as charAt
but range-checked.
Same as charAt
but range-checked.
Returns the input character at the index with the given offset from the cursor.
If this index is out of range the method returns EOI
.
The index of the next (yet unmatched) input character.
The index of the next (yet unmatched) input character.
Might be equal to input.length
!
The next (yet unmatched) input character, i.e.
The next (yet unmatched) input character, i.e. the one at the cursor
index.
Identical to if (cursor < input.length) input.charAt(cursor) else EOI
but more efficient.
Drops one or more values from the top of the value stack.
Drops one or more values from the top of the value stack.
E.g. drop[Int]
will drop the top
value and Int
drop[Int :: String :: HNil]
will drop the top two values,
which must be an
underneath a Int
(the string being the top stack element).
String
The maximum number of error traces that parser will collect in case of a parse error.
The maximum number of error traces that parser will collect in case of a parse error.
Override with a custom value if required.
Set to zero to completely disable error trace collection (which will cause formatError
to no be able to render any "expected" string!).
A rule that always fails and causes the parser to immediately terminate the parsing run.
A rule that always fails and causes the parser to immediately terminate the parsing run. The resulting parse error only has a single trace with a single frame which holds the given error message.
Fully generic variant of fail.
Fully generic variant of fail.
Formats the given ParseError into a String using the given formatter instance.
Matches the given string of characters case insensitively.
Matches the given string of characters case insensitively. Note: the given string must be specified in all lower-case! This requirement is currently NOT enforced!
Matches the given single character case insensitively.
Matches the given single character case insensitively. Note: the given character must be specified in lower-case! This requirement is currently NOT enforced!
Returns the last character that was matched, i.e.
Returns the last character that was matched, i.e. the one at index cursor - 1 Note: for performance optimization this method does *not* do a range check, i.e. depending on the ParserInput implementation you might get an exception when calling this method before any character was matched by the parser.
Converts a compile-time only rule definition into the corresponding rule method implementation with an explicitly given name.
Matches any single character except the ones in the given string and except EOI.
Matches any single character except the ones in the given string and except EOI.
Note: This helper has O(n) runtime with n being the length of the given string. If your string consists only of 7-bit ASCII chars using a pre-allocated CharPredicate will be more efficient.
Runs its inner rule until it fails, succeeds if its inner rule succeeded at least once.
Runs its inner rule until it fails, succeeds if its inner rule succeeded at least once. Resulting rule type is Rule0 if r == Rule0 Rule1[Seq[T]] if r == Rule1[T] Rule[I, O] if r == Rule[I, O <: I] // so called "reduction", which leaves the value stack unchanged on a type level
Runs its inner rule and succeeds even if the inner rule doesn't.
Runs its inner rule and succeeds even if the inner rule doesn't. Resulting rule type is Rule0 if r == Rule0 Rule1[Option[T]] if r == Rule1[T] Rule[I, O] if r == Rule[I, O <: I] // so called "reduction", which leaves the value stack unchanged on a type level
Matches any (single) character matched by the given CharPredicate
.
Matches any (single) character matched by the given CharPredicate
.
Pushes the given value onto the value stack.
Pushes the given value onto the value stack.
- if T
is Unit
nothing is pushed (i.e. push
with a block/expression evaluating to Unit
is identical to run
)
- if T <: HList
all values of the HList is pushed as individual elements
- otherwise a single value of type T
is pushed.
Marks a rule as "quiet" from an error reporting perspective.
Marks a rule as "quiet" from an error reporting perspective. Quiet rules only show up in error rule traces if no "unquiet" rules match up to the error location. This marker frequently used for low-level syntax rules (like whitespace or comments) that might be matched essentially everywhere and are therefore not helpful when appearing in the "expected" set of an error report.
Converts a compile-time only rule definition into the corresponding rule method implementation.
Runs the given block / expression / action function.
Runs the given block / expression / action function.
A run
rule can have several shapes, depending on its argument type. If the arg
evaluates to
- a rule (i.e. has type R <: Rule[_, _]
) the result type of run
is this rule's type (i.e. R
) and the
produced rule is immediately executed.
- a function with 1 to 5 parameters these parameters are mapped against the top of the value stack, popped
and the function executed. Thereby the function behaves just like an action function for the ~>
operator,
i.e. if it produces a Unit value this result is simply dropped. HList results are pushed onto the value stack
(all their elements individually), rule results are immediately executed and other result values are pushed
onto the value stack as a single element.
- a function with one HList parameter the behavior is similar to the previous case with the difference that the
elements of this parameter HList are mapped against the value stack top. This allows for consumption of an
arbitrary number of value stack elements. (Note: This feature of
is not yet currently implemented.)run
- any other value the result type of run
is an always succeeding Rule0
.
NOTE: Even though the block is not a call-by-name parameter it will be executed
for every rule application anew! (Since the expression is directly transplanted
into the rule method by the rule
macro.
Allows creation of a sub parser and running of one of its rules as part of the current parsing process.
Allows creation of a sub parser and running of one of its rules as part of the current parsing process. The subparser will start parsing at the current input position and the outer parser (this parser) will continue where the sub-parser stopped.
Matches the given string of characters.
Matches the given string of characters.
Implements a semantic predicate.
Implements a semantic predicate. If the argument expression evaluates to true
the created
rule matches otherwise it doesn't.
Matches any of the given maps keys and pushes the respective value upon a successful match.
Matches any of the given maps keys and pushes the respective value upon a successful match.
Allows "raw" (i.e.
Allows "raw" (i.e. untyped) access to the ValueStack
.
In most cases you shouldn't need to access the value stack directly from your code.
Use only if you know what you are doing!
Runs its inner rule until it fails, always succeeds.
Runs its inner rule until it fails, always succeeds. Resulting rule type is Rule0 if r == Rule0 Rule1[Seq[T]] if r == Rule1[T] Rule[I, O] if r == Rule[I, O <: I] // so called "reduction", which leaves the value stack unchanged on a type level