Skip to content

%default_destructor

ksherlock edited this page Dec 19, 2015 · 1 revision

The %default_destructor directive

The %default_destructor directive specifies the default destructor for non-terminals. See also the %destructor directive to specify the destructor for an individual non-terminal and the %token_destructor directive to specify the destructor for terminals.

%default_destructor { free($$); }

vs

%destructor nt1 { free($$); }
%destructor nt2 { free($$); }
%destructor nt3 { free($$); }
...
Clone this wiki locally