On Mon, 30 Jan 2006, Joel E. Denny wrote:

> Now that I look over your example grammars, it's clear to me that the 
> warnings are sometimes too much.  But perhaps the solution is just to have 
> two levels of warnings:

[snip]

> c. For a $$ or $n that corresponds to a mid-rule action, bison warns if 
> one is mentioned but not the other... because that just seems bizarre and 
> likely a mistake.  It's bizarre regardless of whether there's a 
> %destructor for the used type.  %type is impossible of course.

The second to last sentence is flawed.  You don't declare %destructor for 
a type.  You declare it for a symbol.  Thus, neither %destructor nor %type 
can be declared for mid-rule action values.

You can convert a mid-rule action to a nonterminal, but it seems there is 
no other way to prevent its value from being leaked during error recovery. 
Is my understanding correct?

Joel


Reply via email to