Struct xxcalc::parser::Operator
[−]
[src]
pub struct Operator(_, _);
Stores operator precedence and its associativity.
Both features are essential when parsing mathematical expressions. An operator precedence defines its priority, operators with larger precedence are evaluated before operators with smaller precedence. An associativity resolves conflicts when two operators are of the same precedence - a left-associative operator evaluates LHS before RHS, while a right-associative operator evalutes RHS before LHS.
Knowledge of these features is required to properly convert infix form into RPN.
Methods
impl Operator
[src]
fn new(p: i64, a: OperatorAssociativity) -> Operator
Creates a new operator with given precedence and associativity.
Trait Implementations
impl PartialEq for Operator
[src]
fn eq(&self, __arg_0: &Operator) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Operator) -> bool
This method tests for !=
.