I need to make a simple calculator (with infix operator) parser that handle the operators +,-,*,/ and float and variable. To make this I used javacc, and I have made this grammar with jjtree. It works but it doesn't ensure that the final tree will be a binary tree, which I need. I want something like 5*3+x-y to generate the following tree :
*
/ \
5 +
/ \
3 -
/ \
x y
What would be a proper grammar to do that, that would not be left-recursive ?