In most programs, you will need different data types for different kinds
of tokens and groupings. For example, a numeric constant may need type
long int, while a string constant needs type
char *, and an identifier might need a pointer to an entry in the
To use more than one data type for semantic values in one parser, Bison requires you to do two things:
%unionBison declaration (see The Collection of Value Types), or by using a
YYSTYPEto be a union type whose member names are the type tags.
%tokenBison declaration (see Token Type Names) and for groupings with the
%typeBison declaration (see Nonterminal Symbols).