bison-patches
[Top][All Lists]
Advanced

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

Re: bison.simple patch for destruction of semantic values during error r


From: Cris Bailiff
Subject: Re: bison.simple patch for destruction of semantic values during error recovery
Date: Wed, 12 Jun 2002 10:30:14 +1000

On Tue, 11 Jun 2002 19:39, Akim Demaille wrote:
> >>>>> "Cris" == Cris Bailiff <address@hidden> writes:
>
> Cris> Hi, Please find attached a suggested patch for bison.simple
> Cris> (against current CVS HEAD), which defines a couple of optional
> Cris> hooks where the generated parser can call user-define code to
> Cris> deal with the contents of a semantic value just before the value
> Cris> is discarded during error recovery.
>
> We do need something like your patch, agreed.  But I don't want to
> apply it, because it is very unclear what its interface should be.
> Maybe we want something like
>
> %free foo { foo_free ($$); }
> %free bar { bar_free ($$); }
>
> instead.  Maybe we want something à la YYPRINT (well, I doubt it,
> since it does not cope well with nonterminals).

I didn't quite understand how bison will know when a semantic value is a foo 
or a bar, but I'm sure it will 'do the right thing' eventually :-) 

I suppose '%free' is the correct generic term. (We don't actually 'free' 
anything in our application, just re-link the discards onto another list, for 
later output. (It's a filter, so we don't want to loose source text we don't 
understand)). Maybe '%finalize' is more politically correct?

> I am currently rewriting Bison's reader in Bison.  *Then* we well have
> all the needed freedom to finally fix this very problematic bug.
>
> I hope this is not too much of a problem for you?

I don't mind - I'm happy to use BISON_SIMPLE=local.bison.simple for internal 
use - I just prefer to make sure that such options are recorded somewhere 
public for future reference, even if they aren't going in the current source.

Cris

P.S. Apologies for the 'confirm' to the list earlier - Mozilla won't let me 
set the 'From' address very easily, so I ended up cutting and pasting between 
mailers, and messed up. I was surprised mailman didn't catch it though...

address@hidden - http://www.awayweb.com







reply via email to

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