‘YYSTYPE’ has no member named ‘int_double_string’
The id in %type <id>
and %token <id>
needs to be a field in the yyunion
.
So, the tokens defined as type int_double_string need to be type ids
%token <int_double_string> VALUE
%type <int_double_string> key_expr
like this
%token <ids> VALUE
%type <ids> key_expr
And the second argument to addPair
should be a union int_double_string*
In typical yacc usage you would put all these fields:
short type; //0:int 1:double 2:string
int intValue;
double doubleValue;
char *stringVal;
Into the yyunion itself and not have a union field in yyunion. I'm not saying you can't but it is unusual.