Similar to my recursive decent parser in Ruby. Seems to do everything correctly (matches my system calculator with a bunch of inputs). Builds a tree from input in order to correctly bind tokens in order of precedence:
Highest >> Lowest
-
Base Numbers / Parenthesis
-
Multiplcation / Division
-
Addition / Subtraction.
Nothing else is supposed (it's very simple).