Packages

  • package root

    This is the documentation for Parsley.

    This is the documentation for Parsley.

    Package structure

    The parsley package contains the Parsley class, as well as the Result, Success, and Failure types. In addition to these, it also contains the following packages and "modules" (a module is defined as being an object which mocks a package):

    • parsley.Parsley contains the bulk of the core "function-style" combinators, as well as the implicit classes which enable the "method-style" combinators.
    • parsley.combinator contains many helpful combinators that simplify some common parser patterns.
    • parsley.character contains the combinators needed to read characters and strings, as well as combinators to match specific sub-sets of characters.
    • parsley.debug contains debugging combinators, helpful for identifying faults in parsers.
    • parsley.io contains extension methods to run parsers with input sourced from IO sources.
    • parsley.expr contains the following sub modules:
    • parsley.implicits contains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:
      • parsley.implicits.character contains implicits to allow you to use character and string literals as parsers.
      • parsley.implicits.combinator contains implicits related to combinators, such as the ability to make any parser into a Parsley[Unit] automatically.
      • parsley.implicits.lift enables postfix application of the lift combinator onto a function (or value).
      • parsley.implicits.zipped enables boths a reversed form of lift where the function appears on the right and is applied on a tuple (useful when type inference has failed) as well as a .zipped method for building tuples out of several combinators.
    • parsley.errors contains modules to deal with error messages, their refinement and generation.
      • parsley.errors.combinator provides combinators that can be used to either produce more detailed errors as well as refine existing errors.
    • parsley.lift contains functions which lift functions that work on regular types to those which now combine the results of parsers returning those same types. these are ubiquitous.
    • parsley.registers contains combinators that interact with the context-sensitive functionality in the form of registers.
    • parsley.token contains the Lexer class that provides a host of helpful lexing combinators when provided with the description of a language.
    • parsley.unsafe contains unsafe (and not thread-safe) ways of speeding up the execution of a parser.
    Definition Classes
    root
  • package parsley
    Definition Classes
    root
  • package errors
    Definition Classes
    parsley
  • package expr
    Definition Classes
    parsley
  • Atoms
  • Fixity
  • GOps
  • InfixL
  • InfixR
  • Level
  • Levels
  • NonAssoc
  • Ops
  • Postfix
  • Prefix
  • SOps
  • chain
  • precedence
  • package implicits
    Definition Classes
    parsley
  • package token
    Definition Classes
    parsley

package expr

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. sealed trait Fixity extends AnyRef

    Denotes the fixity and associativity of an operator.

    Denotes the fixity and associativity of an operator. Importantly, it also specifies the type of the of the operations themselves. For non-monolithic structures this is described by fixity.GOp, subtyped structures fixity.SOp, and for monolithic structures fixity.Op.

    Since

    2.2.0

  2. case class Level[-A, B, C](lvls: Levels[A, B], ops: Ops[B, C]) extends Levels[A, C] with Product with Serializable

    This represents a single new level of the hierarchy, with stronger precedence than its tail.

    This represents a single new level of the hierarchy, with stronger precedence than its tail.

    A

    The base type accepted by the layer below

    B

    The intermediate type produced by the layer below to be fed into this level

    C

    The type of structure produced by this layer

    lvls

    The next, stronger, levels in the precedence table

    ops

    The operators accepted at this level

    returns

    A larger precedence table transforming atoms of type A into a structure of type C.

    Since

    3.0.0

  3. sealed trait Levels[-A, +B] extends AnyRef

    For more complex expression parser types Levels can be used to describe the precedence table whilst preserving the intermediate structure between each level.

    For more complex expression parser types Levels can be used to describe the precedence table whilst preserving the intermediate structure between each level.

    A

    The base type accepted by this list of levels

    B

    The type of structure produced by the list of levels

    Since

    3.0.0

  4. trait Ops[-A, B] extends AnyRef

    Describes the operators at a specific level in the precedence tree, such that these ops consume Bs, possibly As and produce Bs: this depends on the Fixity of the operators.

    Describes the operators at a specific level in the precedence tree, such that these ops consume Bs, possibly As and produce Bs: this depends on the Fixity of the operators.

    A

    The base type consumed by the operators

    B

    The type produced/consumed by the operators

    Since

    2.2.0

    Note

    For less complex types Ops[A, A] is sufficient

Value Members

  1. object Atoms

    This represents the final level of the hierarchy, with the strongest binding.

  2. object GOps

    Helper object to build values of Ops[A, B], for generalised precedence parsing

    Helper object to build values of Ops[A, B], for generalised precedence parsing

    Since

    2.2.0

  3. case object InfixL extends Fixity with Product with Serializable

    Describes left-associative binary operators

    Describes left-associative binary operators

    Since

    2.2.0

  4. case object InfixR extends Fixity with Product with Serializable

    Describes right-associative binary operators

    Describes right-associative binary operators

    Since

    2.2.0

  5. case object NonAssoc extends Fixity with Product with Serializable

    Describes non-associative operators

    Describes non-associative operators

    Since

    3.0.0

  6. object Ops

    Helper object to build values of Ops[A, A], for monolithic precedence parsing

    Helper object to build values of Ops[A, A], for monolithic precedence parsing

    Since

    2.2.0

  7. case object Postfix extends Fixity with Product with Serializable

    Describes unary postfix operators

    Describes unary postfix operators

    Since

    2.2.0

  8. case object Prefix extends Fixity with Product with Serializable

    Describes unary prefix operators

    Describes unary prefix operators

    Since

    2.2.0

  9. object SOps

    Helper object to build values of Ops[A, B], for precedence parsing with subtyped data-structures.

    Helper object to build values of Ops[A, B], for precedence parsing with subtyped data-structures.

    Since

    3.0.0

  10. object chain

    This module contains the very useful chaining family of combinators, which are mostly used to parse operators and expressions of varying fixities.

    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

  11. object precedence

    This object is used to construct precedence parsers from either a Levels or many Ops[A, A].

    This object is used to construct precedence parsers from either a Levels or many Ops[A, A].

    Since

    2.2.0

Ungrouped