the type of input elements the provided parsers consume (When consuming invidual characters, a parser is typically
called a scanner, which produces
tokens that are consumed by what is normally called a
parser.
Nonetheless, the same principles apply, regardless of the input type.)
The fatal failure case of ParseResult: contains an error-message and the remaining input .
The failure case of ParseResult: contains an error-message and the remaining input .
The parser input is an abstract reader of input elements, i .
A common super-class for unsuccessful parse results
A parser whose ~ combinator disallows back-tracking .
A base class for parser results .
The root class of parsers .
The success case of ParseResult: contains the result and the remaining input .
An extractor so NoSuccess(msg, next) can be used in matches .
The parser that matches an element in the domain of the partial function f'
If
f' is defined on the first element in the input, f' is applied to it to produce
this parser's result.
Example: The parser accept("name", {case Identifier(n) => Name(n)})
accepts an Identifier(n) and returns a Name(n).
A parser that matches only the given list of element es'
accept(es) succeeds if the input subsequently provides the elements in the list
es'.
A parser that matches only the given element e'
The method is implicit so that elements can automatically be lifted to their parsers.
For example, when parsing
Token's, Identifier("new") (which is a Token') can be used directly,
instead of first creating a
Parser' using accept(Identifier("new")).
A parser generator that, roughly, generalises the rep1sep generator so that q', which parses the separator,
produces a left-associative function that combines the elements it separates.
A parser generator that, roughly, generalises the rep1sep generator so that q', which parses the separator,
produces a left-associative function that combines the elements it separates.
From: J. Fokker. Functional parsers. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, volume 925 of Lecture Notes in Computer Science, pages 1--23. Springer, 1995.
A parser generator that generalises the rep1sep generator so that q', which parses the separator,
produces a right-associative function that combines the elements it separates. Additionally,
The right-most (last) element and the left-most combining function have to be supplied.
rep1sep(p: Parser[T], q) corresponds to chainr1(p, q ^^ cons, cons, Nil) (where val cons = (x: T, y: List[T]) => x :: y)
Wrap a parser so that its failures become errors (the | combinator will give up as soon as it encounters an error, on failure it simply tries the next alternative)
A parser that matches only the given element e'
elem(e) succeeds if the input starts with an element
e'
A parser matching input elements that satisfy a given predicate
A parser that results in an error
A parser that always fails
A parser generator for guard expressions .
A parser that matches a literal string
Wrap a parser so that its failures&errors become success and vice versa -- it never consumes any input
A parser generator for optional sub-phrases .
Parse some prefix of reader in' with parser
p'
Parse some prefix of character sequence in' with parser
p'
Parse some prefix of reader in' with parser
p'
Parse all of character sequence in' with parser
p'
Parse all of reader in' with parser
p'
Parse all of reader in' with parser
p'
A parser generator delimiting whole phrases (i .
positioned' decorates a parser's result with the start position of the input it consumed.
If whitespace is being skipped, then it is skipped before the start position is recorded.
A parser that matches a regex string
A parser generator for repetitions .
A parser generator for non-empty repetitions .
A parser generator for non-empty repetitions .
A parser generator for non-empty repetitions .
A parser generator for a specified number of repetitions .
A parser generator for interleaved repetitions .
A parser that always succeeds