Trait xxcalc::calculator::Calculator [] [src]

pub trait Calculator<T, P, E> where T: StringProcessor + Default, P: TokensProcessor + Default, E: TokensReducer + Default {
    fn process(&self, line: &str) -> Result<PolynomialCalculationError> { ... }
}

Calculator is the easiest way of evaluating string expressions into a Polynomial value.

A struct which is a calculator (implements this trait) can easily perform evaluation using given StringProcessor, TokensProcessor and TokensReducer.

Provided Methods

Takes string and evaluates it into a Polynomial.

This method creates a new instance of tokenizer, parser and evaluator for each execution. While it is easy to use, it is not the quickest way of evaluation when there are multiple expression.

Implementors