Implement the Shunting-yard algorithm for infix input