Algebraic expression parser that considers operator precedence.