A simple expression parser, that allows parsing and evaluating strings that describe mathematical operations.
The following operators are included by default:
It will also detect and warn about mismatching/missing parentheses, in which case it will always return a configurable error value.
It's basically a slightly modified implementation of the shunting yard algorithm by Dijkstra, with the addition of an evaluator for the post-fix notation it creates and a tokenizer for input strings.
Adding new operators has been overhauled in version 1.4.0. To add an operator, simply duplicate one of the existing ones in the Operator folder and modify it entirely to your needs. The top part determines the operator's properties (symbol, precedence, etc), the bottom part defines the operation. It should automatically be found as long as its file name has the prefix "_EP_OP_".
evaluate_expression("(1+2)^3") output: 27
Version 1.4.6. Published July 11, 2018
This asset hasn't received enough reviews yet.
You can only review assets you've bought.
Very good parser +
This review was left for a previous version of this asset.
This should be resolved in version 1.4.2, let me know if there are any other issues.