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]

Creates a new operator with given precedence and associativity.

Trait Implementations

impl PartialEq for Operator
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Operator
[src]

Formats the value using the given formatter.