So I’m getting type clashes in bison, of the form
warning: type clash on default action: <stmt> != <expr>
because I have a production like
%type <stmt> Stmt
%type <expr> Expr
...
Stmt : Expr /* empty */
| Otherstuff {do other stuff.....}
;
I was wondering if there was a way to get rid of these errors, because Expr is a subclass of Stmt (I’m using c++), but has extra functions so just putting in
%type <stmt> Stmt Expr
won’t work. Any ideas?
The easy way is: