Hi all. I'm writing a program with Yacc/Flex and I'm using the following code (not exactly the same because I'm mixing code from other file):
DataType datat;
%union {
int integer;
char *string;
DataType type;
}
Integer { yylval.type = INTEGER; return INT; }
%type <type> INT
data : INTNUM { yylval.type = INTEGER; }
Then if I write something like this:
foo : data { bar(yylval.type); }
bar gets correctly the datatype INTEGER, but if I have this:
foo : data data { ??? }
How do I get the yylval.type for the first and second member separately?
Thanks a lot!