parsley.expr
Members list
Fixities
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.
Attributes
- Since:
4.0.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
Table
This class is the base of a precedence table.
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.
Attributes
- 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.
- Since:
4.0.0
- Graph
- Supertypes
This class allows for the description of a single layer of operators in the precedence tree.
This class allows for the description of a single layer of operators in the precedence tree.
Describes the operators at a specific level in the precedence tree, such that these ops
consume B
s, possibly A
s and produce B
s: this depends on the Fixity of the operators.
Attributes
- 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.- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
This class is the base type for precedence tables.
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
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- class Atoms[A]
Builders
This helper object builds values of Ops[A, B]
, for fully heterogeneous precedence parsing.
This helper object builds values of Ops[A, B]
, for fully heterogeneous precedence parsing.
Attributes
- Since:
2.2.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- GOps.type
This helper object builds values of Ops[A, B]
where A <: B
, for subtyped heterogeneous precedence parsing.
This helper object builds values of Ops[A, B]
where A <: B
, for subtyped heterogeneous precedence parsing.
Attributes
- Since:
3.0.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- SOps.type
Chains
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.
Attributes
- Since:
2.2.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- chain.type
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.
Compared with the combinators in chain, these allow for more freedom in the type of the values and the operators.
Attributes
- Since:
4.0.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- infix.type
This module contains specialist combinators for mixing unary and binary operators on the same level.
This module contains specialist combinators for mixing unary and binary operators on the same level. This is only sensible when mixing infix-left and postfix or infix-right and prefix.
Attributes
- Since:
4.0.0
- Note:
the behaviour of the enclosed combinators may be counter intuitive: they should not be used unless you know what you are doing.
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- mixed.type
Precedence
This object is used to construct precedence parsers from either a Prec
or many Ops[A, A]
.
This object is used to construct precedence parsers from either a Prec
or many Ops[A, A]
.
Contained within this object are three different shapes of apply
functions: they allows for
the construction of a precedence parser from either: a collection of levels of operators and atoms,
in either weak-to-strong or strong-to-weak orderings; or a heterogeneous precedence table Prec
.
Attributes
- Since:
2.2.0
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- precedence.type