Packages

p

laika

parse

package parse

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class Failure(msgProvider: Message, next: ParserContext, maxOffset: Int) extends Parsed[Nothing] with Product with Serializable

    The failure case of Parsed containing an error message and the remaining input.

    The failure case of Parsed containing an error message and the remaining input.

    Implementation note: The message property is of type Message, to allow for lazy message creation. The former SDK parser combinators which this API is partially inspired by contained a lot of unnecessary string concatenations for messages which were then never read. This implementation avoids this extra cost and the result is measurable (about 15% performance gain for a typical Markdown document for example).

    msgProvider

    A provider that produces an error message for this failure based on its ParserContext

    next

    The unconsumed input at the point where the failing parser started

    maxOffset

    The offset position the parser could successfully read to before failing

  2. trait Message extends AnyRef

    Represents a lazy failure message.

    Represents a lazy failure message. Implementations can use the specified ParserContext to construct the actual message, e.g. for adding parts of the input to the message.

  3. sealed abstract class Parsed[+T] extends AnyRef

    Represents the result of a Parser, a value of type T in case of success, a message in case of failure as well as the ParserContext for the remaining input.

  4. abstract class Parser[+T] extends AnyRef

    The abstract base for all parser implementations.

    The abstract base for all parser implementations.

    Contains the main parse function as well as various combinator function to create a new parser based on this one.

  5. case class ParserContext(source: Source, offset: Int, nestLevel: Int) extends Product with Serializable

    Represents the state and context of a parsing operation, containing the input string as well as positional information/

  6. case class Position(s: Source, offset: Int) extends Product with Serializable

    Represents an offset into a source string.

    Represents an offset into a source string. Its main purpose is error reporting, e.g. printing a visual representation of the line containing the error.

    s

    the source for this position

    offset

    the offset into the source string

  7. case class Source(value: String) extends Product with Serializable

    Represents the input string for a parsing operation.

  8. case class Success[+T](result: T, next: ParserContext) extends Parsed[T] with Product with Serializable

    The success case of Parsed containing the result and the remaining input.

Value Members

  1. object Failure extends Serializable
  2. object Message

    Message companion providing several pre-built messages and factory methods.

  3. object Parser

    Companion factory for creating new parser instances.

  4. object ParserContext extends Serializable

    Companion for creating new ParserContext instances.

  5. object builders extends TextParsers with InlineParsers with BlockParsers

    Grouping of all parser builders that allows to construct most common parsers with a single import.

    Grouping of all parser builders that allows to construct most common parsers with a single import.

    These include the base parsers like opt and not, the text parsers like literal and anyOf(Char*), as well as the more specialized parsers for text markup like spans and blocks.

    Alternatively these groups can be brought into scope individually.

  6. object implicits

    Collection of extension methods that helps keeping parser definitions concise.

    Collection of extension methods that helps keeping parser definitions concise.

    It includes extension methods on string that allows to use string literals in parser definitions like "{" ~ anyNot('}') ~ "}" and extensions for parsers for particular target types, e.g. concat for a Parser[Seq[A], Seq[A]] and mapN for any parser Parser[A ~ B ~ C] (up to 5 concatenated elements).

Ungrouped