Infix expression (with negative numbers) to postfix
The two most common approaches to evaluating simple mathematical expressions are :


Parse the expression into an Abstract Syntax Tree, and then evaluate the tree.
Process the expression using Dijkstra's Shunting-yard algorithm.