Crate arithmetic_parser_kma

Source

Modules§

cli
cli ia a modul with cli implementation.
io
Traits, helpers, and type definitions for core I/O functionality.

Structs§

MyParser
Pairs
An iterator over Pairs. It is created by pest::state and Pair::into_inner.
PrattParser
Struct containing operators and precedences, which can perform Pratt parsing on primary, prefix, postfix and infix expressions over Pairs. The tokens in Pairs should alternate in the order: prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix*)*

Enums§

Expr
MyError
MyError is an error type used to return errors from the parser.
Op
Op describes a mathematical operation.
Rule

Traits§

BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
Parser
A trait with a single method that parses strings.

Functions§

eval_expr
Evaluate the given expression and return the result.
eval_expr_from_string
Evaluate an expression from a string input and return the result.
parse_expr
Parse the input pairs into an abstract syntax tree representing the expression.

Derive Macros§

Error
Parser
The main method that’s called by the proc macro (a wrapper around pest_generator::derive_parser)