chain

object chain

This module contains the very useful chaining family of combinators, which are mostly used to parse operators and expressions of varying fixities. It is a more low-level API compared with precedence.

This module contains the very useful chaining family of combinators, which are mostly used to parse operators and expressions of varying fixities. It is a more low-level API compared with precedence.

Since

2.2.0

class Object
trait Matchable
class Any

Value members

Concrete methods

def left[A, B](p: => Parsley[A], op: => Parsley[(B, A) => B], x: B)(@implicitNotFound("Please provide a wrapper function from ${A} to ${B}") wrap: A => B): Parsley[B]

left(p, op, x) 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 no occurrences of p, the value x is returned.

left(p, op, x) 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 no occurrences of p, the value x is returned.

Since

2.2.0

def left1[A, B](p: => Parsley[A], op: => Parsley[(B, A) => B])(@implicitNotFound("Please provide a wrapper function from ${A} to ${B}") wrap: A => B): Parsley[B]

left1(p, op) parses one or more occurrences of p, separated by op. Returns a value obtained by a left associative application of all functions return 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.

left1(p, op) parses one or more occurrences of p, separated by op. Returns a value obtained by a left associative application of all functions return 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.

Since

2.2.0

def postfix[A](p: => Parsley[A], op: => Parsley[A => A]): Parsley[A]

postfix(p, op) parses one occurrence of p, followed by many postfix applications of op that associate to the left.

postfix(p, op) parses one occurrence of p, followed by many postfix applications of op that associate to the left.

Since

2.2.0

def postfix1[A, B <: A](p: => Parsley[A], op: => Parsley[A => B]): Parsley[B]

postfix1(p, op) parses one occurrence of p, followed by one or more postfix applications of op that associate to the left.

postfix1(p, op) parses one occurrence of p, followed by one or more postfix applications of op that associate to the left.

Since

3.0.0

def prefix[A](op: => Parsley[A => A], p: => Parsley[A]): Parsley[A]

prefix(op, p) parses many prefixed applications of op onto a single final result of p

prefix(op, p) parses many prefixed applications of op onto a single final result of p

Since

2.2.0

def prefix1[A, B <: A](op: => Parsley[A => B], p: => Parsley[A]): Parsley[B]

prefix1(op, p) parses one or more prefixed applications of op onto a single final result of p

prefix1(op, p) parses one or more prefixed applications of op onto a single final result of p

Since

3.0.0

def right[A, B](p: => Parsley[A], op: => Parsley[(A, B) => B], x: B)(@implicitNotFound("Please provide a wrapper function from ${A} to ${B}") wrap: A => B): Parsley[B]

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 return by op to the values returned by p. If there are no occurrences of p, the value x is returned.

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 return by op to the values returned by p. If there are no occurrences of p, the value x is returned.

Since

2.2.0

def right1[A, B](p: => Parsley[A], op: => Parsley[(A, B) => B])(@implicitNotFound("Please provide a wrapper function from ${A} to ${B}") wrap: A => B): Parsley[B]

right1(p, op) parses one or more occurrences of p, separated by op. Returns a value obtained by a right associative application of all functions return by op to the values returned by p.

right1(p, op) parses one or more occurrences of p, separated by op. Returns a value obtained by a right associative application of all functions return by op to the values returned by p.

Since

2.2.0