[Joel, I added some clarifications at the bottom]
  grammar(): defs() rules() epilogue(!) {
    $grammar = new_grammar ($defs, $rules);
  }
  ;
Here you won't break grammar source compatibility by omitting the () altogether.
  %destructor(!) { printf ("A symbol was discarded.\n"); } <!>

Here, symbols with no type tags have no values but still have a %destructor.

Of course, if no symbols in your grammar have type tags, or if you plan to use $<tag>$ extensively for untagged symbols, it might be reasonable to have <!> without (!) in a %destructor.
I still don't see much similarity with (!) and Then, why not having

%destructor BLOCK

implement a <*> destruction, and something like

%destructor(!) BLOCK
%destructor BLOCK %pragma(unused-value)

implement a <!> destruction? Going for the latter, of course, would imply the possibility to do

%destructor BLOCK %pragma(unused-value) <foo>

even if foo is not untagged.

For now, this would mean having only the semantics of <*> available. But besides debugging code, why would <!> functionality be useful?

Paolo


Reply via email to