Mathematical expressions evaluator in Scala