Comment
Comment by ogogmad
Have people heard of the following top-down parsing algorithm for mathematical expressions:
It's easy to speed up step 2 by keeping a table of all the operators in an expression, sorted by their precedence levels. For this table to work properly, the positions of all the tokens must never change.