help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different behaviour with string and number tokens ?


From: Arno Wilhelm
Subject: Re: Different behaviour with string and number tokens ?
Date: Wed, 19 Apr 2006 08:30:47 +0200
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)

Tis does not work in the case of syntax input errors, though, because then the action is not executed. So then a way forward is to use % destructor, somehow. You might want creating a new Help-Bison thread about cleanups, to get the attention of some of the experts on this.

Ok, I will do that.

thanks,
arno



On 18 Apr 2006, at 15:02, Arno Wilhelm wrote:

Hello,

But I get a memory leak even when I free the the in the bison file like this: WORD EQUAL WORD { $$ = !strncmp( $1, $3, 128 ); free ( yylval.str ); }


have found out how to avoid the memory leak myself and thought I would post it here
in case somebody runs into the same issue.

One has to free the variables like this:

WORD EQUAL WORD { $$ = !strcmp( $1, $3 ); free($1); free($3); }



regards,
arno








reply via email to

[Prev in Thread] Current Thread [Next in Thread]