Parser combinators for expressions.
Parser combinators for expressions.
(chain0-left p op x)
This parser parses zero or more occurrences of p
, separated by op
.
Returns a value obtained by a left associative application of all functions
returned by op
to the values returned by p
. If there are zero occurrences
of p
, the value x
is returned.
This parser parses _zero_ or more occurrences of `p`, separated by `op`. Returns a value obtained by a _left_ associative application of all functions returned by `op` to the values returned by `p`. If there are zero occurrences of `p`, the value `x` is returned.
(chain0-right p op x)
Parses zero or more occurrences of p
, separated by op
. Returns a value
obtained by a right associative application of all functions returned by
op
to the values returned by p
. If there are no occurrences of p
, the
value x
is returned.
Parses _zero_ or more occurrences of `p`, separated by `op`. Returns a value obtained by a _right_ associative application of all functions returned by `op` to the values returned by `p`. If there are no occurrences of `p`, the value `x` is returned.
(chain1-left p op)
This parser parses one or more occurrences of p
, separated by op
Returns a value obtained by a left associative application of all functions
returned by op
to the values returned by p
. This parser can for example be
used to eliminate left recursion which typically occurs in expression
grammars.
This parser parses _one_ or more occurrences of `p`, separated by `op` Returns a value obtained by a _left_ associative application of all functions returned by `op` to the values returned by `p`. This parser can for example be used to eliminate left recursion which typically occurs in expression grammars.
(chain1-right p op)
This parser parses one or more occurrences of p
, separated by op
.
Returns a value obtained by a right associative application of all functions
returned by op
to the values returned by p
.
This parser parses _one_ or more occurrences of `p`, separated by `op`. Returns a value obtained by a _right_ associative application of all functions returned by `op` to the values returned by `p`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close