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.
    • 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.expr contains the following sub modules:
      • parsley.expr.chain contains combinators used in expression parsing
      • parsley.expr.precedence is a builder for expression parsers built on a precedence table.
      • parsley.expr.infix contains combinators used in expression parsing, but with more permissive types than their equivalents in chain.
      • parsley.expr.mixed contains combinators that can be used for expression parsing, but where different fixities may be mixed on the same level: this is rare in practice.
    • parsley.syntax contains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:
      • parsley.syntax.character contains implicits to allow you to use character and string literals as parsers.
      • parsley.syntax.lift enables postfix application of the lift combinator onto a function (or value).
      • parsley.syntax.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.syntax.extension contains syntactic sugar combinators exposed as implicit classes.
    • parsley.errors contains modules to deal with error messages, their refinement and generation.
    • 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.ap contains functions which allow for the application of a parser returning a function to several parsers returning each of the argument types.
    • parsley.state contains combinators that interact with the context-sensitive functionality in the form of state.
    • parsley.token contains the Lexer class that provides a host of helpful lexing combinators when provided with the description of a language.
    • parsley.position contains parsers for extracting position information.
    • parsley.generic contains some basic implementations of the Parser Bridge pattern (see Design Patterns for Parser Combinators in Scala, or the parsley wiki): these can be used before more specialised generic bridge traits can be constructed.
    Definition Classes
    root
  • package parsley
    Definition Classes
    root
  • package expr

    This package contains various functionality relating to the parsing of expressions..

    This package contains various functionality relating to the parsing of expressions..

    This includes the "chain" combinators, which tackle the left-recursion problem and allow for the parsing and combining of operators with values. It also includes functionality for constructing larger precedence tables, which may even vary the type of each layer in the table, allowing for strongly-typed expression parsing.

    Definition Classes
    parsley
  • Atoms
  • Fixity
  • GOps
  • InfixL
  • InfixN
  • InfixR
  • Ops
  • Postfix
  • Prec
  • Prefix
  • SOps
  • chain
  • infix
  • mixed
  • precedence

case class Atoms[+A](atom0: Parsley[A], atoms: Parsley[A]*) extends Prec[A] with Product with Serializable

This class is the base of a precedence table.

Forms the base of a precedence table, requiring at least one atom to be provided. This first atom will be parsed first.

A

the type of the atoms.

atom0

the first atom found at the root of the precedence table.

atoms

any remaining atoms found at the root of the precedence table.

Source
Levels.scala
Since

4.0.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Atoms
  2. Serializable
  3. Product
  4. Equals
  5. Prec
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Atoms(atom0: Parsley[A], atoms: Parsley[A]*)

    atom0

    the first atom found at the root of the precedence table.

    atoms

    any remaining atoms found at the root of the precedence table.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def +:[Aʹ >: A, B](ops: Ops[, B]): Prec[B]

    This method adds a new layer to this precedence table on the left, in a weakest-to-tightest ordering.

    This method adds a new layer to this precedence table on the left, in a weakest-to-tightest ordering.

    This method associates to the right (with this table on the right!), so right-most applications are tighter binding (closer to the atoms) than those to the left. It should not be mixed with :+, which would be confusing and less predictable.

    a weakened version of the type generated by this table, to increase flexibility.

    B

    the result type of the new table.

    ops

    the operators that make up the new level on the table.

    returns

    a new table that incorporates the operators and atoms in this table, along with extra ops.

    Definition Classes
    Prec
  4. final def :+[Aʹ >: A, B](ops: Ops[, B]): Prec[B]

    This method adds a new layer to this precedence table on the right, in a tightest-to-weakest ordering.

    This method adds a new layer to this precedence table on the right, in a tightest-to-weakest ordering.

    This method associates to the left, so left-most applications are tighter binding (closer to the atoms) than those to the right. It should not be mixed with +:, which would be confusing and less predictable.

    a weakened version of the type generated by this table, to increase flexibility.

    B

    the result type of the new table.

    ops

    the operators that make up the new level on the table.

    returns

    a new table that incorporates the operators and atoms in this table, along with extra ops.

    Definition Classes
    Prec
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val atom0: Parsley[A]
  8. val atoms: Parsley[A]*
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def productElementNames: Iterator[String]
    Definition Classes
    Product
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Prec[A]

Inherited from AnyRef

Inherited from Any

Ungrouped