In the Bison 3.0.4 manual in section 3.7.6 on destructors, the example shows:
%union { char *string; } %token <string> STRING1 STRING2 %type <string> string1 string2 %union { char character; } %token <character> CHR %type <character> chr %token TAGLESS %destructor { } <character> %destructor { free ($$); } <*> %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1 %destructor { printf ("Discarding tagless symbol.\n"); } <> The text following the example says: However, when the parser discards a STRING1 or a string1, it also prints its line number to stdout. It performs only the second %destructor in this case, so it invokes free only once. Should the manual reference the third %destructor instead of the second? If not, I'm confused. Thanks, Gary _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison