Implement the shunting-yard algorithm

Change-Id: I2fc97537f880a76fc01b31c599cf68107870aec4