I redefined the type yylvalwith %union:
%union {
int int_val;
double double_val;
}
And I get either yyval.int_val, or yyval.double_valdepending on the type $$.
But as Richard Pennington said, the best way is to look at the generated code .tab.c.
source
share