Hi
I allocate a new object for each token, and i would like to delete the
object when the token is not used anymore. Is there any directive that
would run the delete code every time a token is popped from the stack?
I thought %destructor is the one, but now I am not sure... Exemplary
code below/
%union{
char * sval;
Variable * vval;
}
%token VARIABLE
%token Literal
%type <vval> Expression VARIABLE
%type <sval> Literal
%destructor { delete $$; } <vval>
%destructor { delete $$; } Literal
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison