bug-bison
[Top][All Lists]
Advanced

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

Re: Action blocks may not refer to their own value with number


From: Henrik Grubbström
Subject: Re: Action blocks may not refer to their own value with number
Date: Sat, 19 Oct 2002 15:16:15 +0200 (MET DST)

On Sat, 19 Oct 2002, address@hidden wrote:

> On Sat, Oct 19, 2002 at 12:29:02PM +0200, Henrik Grubbstr?m wrote:
> > Found another bug when backporting bison 1.50 kludges:
> > 
> > In bison 1.50 and 1.75 the following construct is no longer accepted:
> > 
> > %union{
> >   int field;
> > %}
> > 
> > %type <field> nonterm
> > 
> > %%
> > 
> > nonterm: { $<field>1 = 0; } ;
> > 
> > %%
> > 
> > The following error is produced:
> > 
> > foo.yacc:9.10-20: invalid value: $1
> > 
> > It works fine in bison 1.35.
> > 
> > The obvious workaround is to refer to the value with $$.
> 
> I disagree: this is the obvious fix to the action.  I hope you never
> relied on this code, coz you can be sure it was never properly honored.
> Not even by pre 1.50, they were just buggy and unable to report the error.

True, my example was a bit short; in the code where I encountered the
problem the use was for clarity.

nonterm: TERM { $<field>2 = val; } more stuff
         { $<field>5 = val2; } even more stuff
         { $$ = funcall($<field>2, $<field>5); }

> 

--
Henrik Grubbström                                       address@hidden
Roxen Internet Software AB





reply via email to

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