Mail Archives: djgpp/1997/04/16/22:49:28
On Wed, 16 Apr 1997, Andrew Crabtree wrote:
> Why aren't you using the %union declaration.
i had only one token in my newbie grammar. but on trying out your solution
it seems that declaring a %union is the right thing *even with a single
token*. i have read the excellent docs that come with the djgpp
distribution of bison/flex and i seemed to have missed this (important?)
point, if it was there. of course, your suggestion now begs the question:
do i need to explicitly declare:
%token <dval> name
..
..
%type <dval> expression
in the case that my union has a single type member, or is
understood by default? i will check it out soon.
thank you for your suggestion,
gurunandan
> %union{
> double dval;
> }
> %token name
> typedef union {
> double dval;
> } YYSTYPE;
- Raw text -