Operational shunting yard algorithm.