Module pratt_parser
Constructs useful in prefix, postfix, and infix operator parsing with the Pratt parsing method.
Structs
- Op An operator that corresponds to a rule.
-
PrattParser
Struct containing operators and precedences, which can perform [Pratt parsing][1] on
primary, prefix, postfix and infix expressions over
Pairs. The tokens inPairsshould alternate in the order:prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix*)* -
PrattParserMap
Product of calling
map_primaryonPrattParser, defines how expressions should be mapped.
Enums
-
Assoc
Associativity of an infix binary operator, used by [
Op::infix(Assoc)].