help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $$ for the midrule at... has no declared type


From: Akim Demaille
Subject: Re: $$ for the midrule at... has no declared type
Date: Wed, 18 Mar 2009 12:24:37 +0100


Le 18 mars 09 à 02:22, Rodrigo Dominguez a écrit :

$ bison -d -o c-parse.c c-parse.y

c-parse.y:1743.19-20: $$ for the midrule at $4 of `structsp_attr' has no
declared type
c-parse.y:1753.19-20: $$ for the midrule at $4 of `structsp_attr' has no
declared


Bison has no means to guess what is the type of $$ in mid-rule actions, you have to tell it using $<type-tag>$. In the following rule, you should should change $$ into $<ttype>$ (since that's how it is used in the action of the whole rule).

structsp_attr:
          struct_head identifier '{'
                { $$ = start_struct (RECORD_TYPE, $2);
                  /* Start scope of tag before parsing components.  */
                }
          component_decl_list '}' maybe_attribute
                { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }


Bugs in previous versions of Bison prevented these errors from being reported.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]