Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 977 Bytes
4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
\DOC ++
\TYPE {(++) : ('a -> 'b * 'c) -> ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e}
\SYNOPSIS
Sequentially compose two parsers.
\DESCRIBE
If {p1} and {p2} are two parsers, {p1 ++ p2} is a new parser that parses as
much of the input as possible using {p1} and then as much of what remains using
{p2}, returning the pair of parse results and the unparsed input.
\FAILURE
Never fails.
\COMMENTS
This is one of a suite of combinators for manipulating ``parsers''. A parser is
simply a function whose OCaml type is some instance of
{:('a)list -> 'b * ('a)list}. The function should take a list of objects of
type {:'a} (e.g. characters or tokens), parse as much of it as possible from
left to right, and return a pair consisting of the object derived from parsing
(e.g. a term or a special syntax tree) and the list of elements that were not
processed.
\SEEALSO
++, >>, |||, a, atleast, elistof, finished, fix, leftbin, listof, many, nothing,
possibly, rightbin, some.
\ENDDOC
|