object ExpressionParser
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This object will be removed in Parsley 3.0, use
parsley.expr.precedence
instead
- Alphabetic
- By Inheritance
- ExpressionParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit class LevelBuilder[B, +C] extends AnyRef
- type MonoOps[A] = expr.Ops[A, A]
Deprecated Type Members
- sealed trait Assoc extends AnyRef
Denotes the associativity of an operator, either
AssocLeft
orAssocRight
.Denotes the associativity of an operator, either
AssocLeft
orAssocRight
.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Infixes for how this is replaced in new-style
- sealed trait Fixity extends AnyRef
Denotes the fixity of an operator, either
Prefix
orPostfix
.Denotes the fixity of an operator, either
Prefix
orPostfix
.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Unaries for how this is replaced in new-style
- type Levels[-A, +B] = expr.Levels[A, B]
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.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This type will be removed in Parsley 3.0, use
parsley.expr.Levels
instead
- type Ops[-A, B] = expr.Ops[A, B]
A list of operators on the same precedence level.
A list of operators on the same precedence level. Note operators of different fixities cannot mix on the same level of indentation. Either
Lefts
which is a list of infix left-assocative operators,Rights
which is a list of infix right-associative operators,Prefixes
which is a list of prefixing unary operators orPostfixes
a list of postfixing unary operators.Each list of operators will also require a wrapping function of type
A => B
. This allows it to convert values of typeA
into values of typeB
when there is no more operation to perform.- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This type will be removed in Parsley 3.0, use
parsley.expr.Ops
instead
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[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Infixes
- object Levels
- object Unaries
Deprecated Value Members
- def apply[A, B](atom: => Parsley[A], table: Levels[A, B]): ExpressionParser[A, B]
This is used to build an expression parser for a multi-layered expression tree type.
This is used to build an expression parser for a multi-layered expression tree type. Levels are specified from strongest to weakest.
- A
The type of the atomic unit of the expression
- B
The type of the resulting parse tree (outermost operations)
- atom
The atomic unit of the expression
- table
A table of operators. Table is ordered highest precedence to lowest precedence. See Levels and it's subtypes for a description of how the types work.
- returns
A parser for the described expression language
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, use
parsley.expr.precedence
instead
- def apply[A](atom: => Parsley[A], table: MonoOps[A]*): ExpressionParser[A, A]
This is used to build an expression parser for a monolithic type.
This is used to build an expression parser for a monolithic type. Levels are specified from strongest to weakest.
- A
The type of the monolithic tree
- atom
The atomic unit of the expression, for instance numbers/variables
- table
A table of operators. Table is ordered highest precedence to lowest precedence. Each list in the table corresponds to operators of the same precedence level.
- returns
A parser for the described expression language
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, use
parsley.expr.precedence
instead
- case object AssocLeft extends Assoc with Product with Serializable
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Infixes for how this is replaced in new-style
- case object AssocRight extends Assoc with Product with Serializable
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Infixes for how this is replaced in new-style
- object Lefts
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This will be removed in Parsley 3.0, use
parsley.expr.GOps
instead
- object Level
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.
- returns
A larger precedence table transforming atoms of type
A
into a structure of typeC
.
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, use
parsley.expr.Level
instead
- case object Postfix extends Fixity with Product with Serializable
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Unaries for how this is replaced in new-style
- object Postfixes
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This will be removed in Parsley 3.0, use
parsley.expr.GOps
instead
- case object Prefix extends Fixity with Product with Serializable
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This class will be removed in Parsley 3.0, see Unaries for how this is replaced in new-style
- object Prefixes
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This will be removed in Parsley 3.0, use
parsley.expr.GOps
instead
- object Rights
- Annotations
- @deprecated
- Deprecated
(Since version v2.2.0) This will be removed in Parsley 3.0, use
parsley.expr.GOps
instead
This is the documentation for Parsley.
Package structure
The parsley package contains the
Parsley
class, as well as theResult
,Success
, andFailure
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.expr
contains the following sub modules:parsley.expr.chain
contains combinators used in expression parsingparsley.expr.precedence
is a builder for expression parsers built on a precedence table.parsley.implicits
contains several implicits to add syntactic sugar to the combinators, such as being able to use character and string literals directly as parsers, as well as enabling lifting of functions to work on parsers.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 theLexer
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.In addition to the modules and packages outlined above, this version of Parsley (up to version 3.0), also includes the so-called
old-style
API, which is deprecated (see the Parsley wiki for a discussion of these differences). You should use the modules described above, and avoid the following:parsley.BitGen
parsley.Char
parsley.CharSet
parsley.Combinator
parsley.ExpressionParser
parsley.Impl
parsley.Implicits
parsley.LanguageDef
parsley.NotRequired
parsley.Parser
parsley.Predicate
parsley.Reg
parsley.TokenParser