Prec

parsley.expr.Prec
sealed abstract class Prec[+A]

This class is the base type for precedence tables.

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

The base of the table will always be an Atoms, and each layer built on top of the last using either the :+ or +: methods.

Attributes

A

the type of structure produced by the list of levels.

Since:

4.0.0

Source:
Levels.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Atoms[A]

Members list

Concise view

Value members

Concrete methods

final def +:[ >: 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.

Attributes

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.

Source:
Levels.scala
final def :+[ >: 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.

Attributes

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.

Source:
Levels.scala