Equation (expression) parser with precedence?
The shunting yard algorithm is the right tool for this. Wikipedia is really confusing about this, but basically the algorithm works like this: Say, you want to evaluate 1 + 2 * 3 + 4. Intuitively, you “know” you have to do the 2 * 3 first, but how do you get this result? The … Read more