Expression evaluation is a common programming task, required in spreadsheets, programming language implementations or as a convenience feature of very various tools.
Mathematical expressions, as written by human, are relatively challenging to evaluate:
Difficulties of straightforward implementation at one time marked expression evaluation as "elite" feature, something that not every programmer knows how to implement. However currently this is less an issue as many open source libraries appeared.
The human written expression is actually the tree, not a list. In this tree, the final constants or variables are leaves, and the operations are nodes. One of the ways to evaluate the expression is to build this tree data structure first, and then evaluate it using recursion. It is always trivial to evaluate the deepest level operations that only have leaves (constants and variables) as they parameters. After evaluation, the node of the operation can be replaced by the single leaf, the computed value. This makes higher level operations possible to compute, while at the end all tree transforms into a single leaf, the value of the expression. For instance, 2 * (2 + 3 * 2 + 2 * 5) is first transformed into 2 * (2 + 6 + 10), then into 2 * 18 and then into 36, the final result.
The alternative approach (also used in the provided applet) is to replace the tree by operation stack and operand stack. Both stacks can be built by parsing the expression from left to right. The complete stacks represent the clear sequence of operations that is already easy to evaluate. Some hardware calculators in the past implemented human-operable stacks to facilitate the computation of complex expressions.
Industrial implementation may contain additional optimizations to avoid evaluating parts that have no impact on the result. For instance, in c and (a or b) neither a nor b has any impact on the result if c = false.