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
Value members
Concrete methods
This is used to build an expression parser for a monolithic type: levels are specified from strongest to weakest.
This is used to build an expression parser for a monolithic type: levels are specified from strongest to weakest.
- Type Params
- A
The type of the monolithic result
- Value Params
- atoms
The atomic units 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
- Since
3.0.0
This is used to build an expression parser for a monolithic type: levels are specified from weakest to strongest.
This is used to build an expression parser for a monolithic type: levels are specified from weakest to strongest.
- Type Params
- A
The type of the monolithic result
- Value Params
- 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
- Since
3.0.0
- Note
due to limitations with type erasure, the
atom
for this function is ''not'' variadic.
This is used to build an expression parser for a multi-layered expression tree type. Levels can be
either tightest to loosest binding (using :+
) or loosest to tightest (using +:
)
This is used to build an expression parser for a multi-layered expression tree type. Levels can be
either tightest to loosest binding (using :+
) or loosest to tightest (using +:
)
- Type Params
- A
The type of the atomic unit of the expression
- B
The type of the resulting parse tree (outermost operations)
- Value Params
- table
A table of operators. Table is ordered depending on the operator used to build it. See Levels and it's subtypes for a description of how the types work.
- Returns
A parser for the described expression language
- Since
3.0.0