I'm not sure what is wrong.

But a good thing with Coco/R compared to other compiler generators is that the generated code is actually readable. So examine the generated code and you will probably see how you should change your input file.

Also take a look at sample calculator grammars to verify that your input is correct.