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: Akim Demaille
Subject: Re: bison.simple patch for destruction of semantic values during error recovery
Date: 12 Jun 2002 09:49:17 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| > 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 :-) 

???  Well, it will know that exactly the same way it understand $$ can
mean $<exp>$ or $<foo>$ etc.  I.e., Using %type and so forth.


| 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 agree with your point, but I dislike very much `finalize' :(  Lemon
uses %destructor.


| 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.

Don't do that: you're lying to it.  Rather, pass -S foo.skel.



reply via email to

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