I am facing a problem that you guys can probably help me solve.
I am trying to parse a grammar that contains this :
Expr: BinOp | Name | Constant ;
Name: id=ID ;
Constant: value=INT ;
BinOp: left=expr op=operator right=expr ;
Operator: Add | Sub ;
Add: 'plus' ;
Sub: 'minus' ;
But this is causing a stack overflow because I guess the BinOp evaluates itself as the left expr and it goes like this forever. Any idea on how to solve the problem ? If possible without the need to add delimiters such as parenthesis.