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: Hans Aberg
Subject: Re: Different behaviour with string and number tokens ?
Date: Tue, 18 Apr 2006 10:00:41 +0200

Yes. But you now get a cleanup-problem -- how remove the strings once used. Since I do not use C, I do not know how people usually solve it.

On 18 Apr 2006, at 09:47, Arno Wilhelm wrote:

This is one of the most FAQ here: you do not copy the string, so you just pass on a pointer to the buffer in the Flex generated lexer, which of course changes in subsequent calls to the lexer.

Ahh, ok. So I could change this behaviour if I would copy the string to a buffer in flex like this:

{WORD}         { strcpy( yylval.str, yytext); return WORD; }


Is this right ?


thanks,
arno





reply via email to

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