I have the following code in yacc:
however it gives me an error :Code:typedef struct data { int type; union { float f; char *str; int v; } d; } data; %} %union { data *typ; ==> error occurs here in the y.tab.h char* stringcon; char charcon; char *id; } %type <typ> expr
y.tab.h:24: error: expected specifier-qualifier-list before âdataâ
Can someone tell me why?