- %union { char *string; }
- %token <string> STRING1
- %token <string> STRING2
- %type <string> string1
- %type <string> string2
- %destructor { free ($$); }
- %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
-
- guarantees that, when the parser discards any user-defined symbol, it passes
- its semantic value to `free'. 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.
+ %union { char *string; }
+ %token <string> STRING1
+ %token <string> STRING2
+ %type <string> string1
+ %type <string> string2
+ %union { char character; }
+ %token <character> CHR
+ %type <character> chr
+ %destructor { free ($$); } %symbol-default
+ %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
+ %destructor { } <character>
+
+ guarantees that, when the parser discards any user-defined symbol that has a
+ semantic type tag other than `<character>', it passes its semantic value to
+ `free'. 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.