Type Members

typeElem = Char

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.

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 method is implicit so that elements can automatically be lifted to their parsers.
For example, when parsing Tokens, Identifier("new") (which is a Token) can be used directly,
instead of first creating a Parser using accept(Identifier("new")).

e

the Elem that must be the next piece of input for the returned parser to succeed

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.

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, q) repeatedly applies p interleaved with q to parse the
input, until p fails. The parser p must succeed at least once.

p

a Parser that is to be applied successively to the input

q

a Parser that parses the elements that separate the elements parsed by p
(interleaved with q)

returns

A parser that returns a list of results produced by repeatedly applying p to the input
(and that only succeeds if p matches at least once).
The results of p are collected in a list. The results of q are discarded.