object Combinators
Parsers which are made up of other parsers, adding to or combining their behavior
- Alphabetic
- By Inheritance
- Combinators
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Capturing
[Elem, Repr](p: Parser[_, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[Repr, Elem, Repr] with Product with Serializable
Captures the string parsed by the given parser p.
- case class Cut [T, Elem, Repr](p: Parser[T, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
-
case class
Either
[T, Elem, Repr](ps: Parser[T, Elem, Repr]*)(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
Parses using one parser or the other, if the first one fails.
Parses using one parser or the other, if the first one fails. Returns the first one that succeeds and fails if both fail
-
case class
Logged
[+T, Elem, Repr](p: Parser[T, Elem, Repr], msg: String, output: (String) ⇒ Unit)(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
Wraps a parser and prints out the indices where it starts and ends, together with its result
-
case class
Lookahead
[Elem, Repr](p: Parser[_, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[Unit, Elem, Repr] with Product with Serializable
Wraps another parser, succeeding/failing identically but consuming no input
- case class NoCut [T, Elem, Repr](p: Parser[T, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
-
case class
NoTrace
[T, Elem, Repr](p: Parser[T, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
Wrap a parser in this if you don't want for it to show up in a stack trace
-
case class
Not
[Elem, Repr](p: Parser[_, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[Unit, Elem, Repr] with Product with Serializable
Wraps another parser, succeeding it it fails and failing if it succeeds.
Wraps another parser, succeeding it it fails and failing if it succeeds. Neither case consumes any input
-
case class
Opaque
[+T, Elem, Repr](p: Parser[T, Elem, Repr], msg: String)(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
A wrapper that replaces target parser and its inner parsers in the stack trace.
A wrapper that replaces target parser and its inner parsers in the stack trace. Useful for providing more high-level error messages without going into details. For example, "expected CharPred(...)..." can become "expected IDENT...".
- msg
The message for the wrapper
-
case class
Optional
[+T, R, Elem, Repr](p: Parser[T, Elem, Repr])(implicit ev: Optioner[T, R], repr: ReprOps[Elem, Repr]) extends Parser[R, Elem, Repr] with Product with Serializable
Wraps a parser and succeeds with
Some
if p succeeds, and succeeds withNone
if p fails. -
case class
Repeat
[T, +R, Elem, Repr](p: Parser[T, Elem, Repr], min: Int, max: Int, delimiter: Parser[_, Elem, Repr])(implicit ev: Repeater[T, R], repr: ReprOps[Elem, Repr]) extends Parser[R, Elem, Repr] with Product with Serializable
Repeats the parser over and over.
-
case class
Rule
[+T, Elem, Repr](name: String, p: () ⇒ Parser[T, Elem, Repr])(implicit repr: ReprOps[Elem, Repr]) extends Parser[T, Elem, Repr] with Product with Serializable
A top-level, named parser.
A top-level, named parser. Lazily evaluates the wrapped parser p only when
parse
is called to allow for circular dependencies between parsers. -
case class
Sequence
[+T1, +T2, R, Elem, Repr](p1: Parser[T1, Elem, Repr], p2: Parser[T2, Elem, Repr], cut: Boolean)(implicit ev: Sequencer[T1, T2, R], repr: ReprOps[Elem, Repr]) extends Parser[R, Elem, Repr] with Product with Serializable
Parsers two things in a row, returning a tuple of the two results if both things succeed
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object Either extends Serializable
-
object
Sequence
extends Serializable
Contains an optimized version of Sequence called Sequence.Flat that combines a tree of Sequence nodes from the left, into a single tail-recursive function working over a
Vector
of their contents.Contains an optimized version of Sequence called Sequence.Flat that combines a tree of Sequence nodes from the left, into a single tail-recursive function working over a
Vector
of their contents.Intentionally completely type-unsafe internally, using casting all over the place, because it's near impossible to make the variable-length heterogenous-typed list type-safe without going crazy. If constructed by
flatten
-ing out a Sequence, the types are checked when the Sequence was constructed, so it's still safe.Appears to speed up the scalaparse.PerfTests benchmark by around 2.5x