add precedence to productions