help-bison
[Top][All Lists]
Advanced

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

Re: Trouble with yytext


From: Hans Aberg
Subject: Re: Trouble with yytext
Date: Thu, 6 Dec 2001 11:36:10 +0100

At 01:36 -0800 2001/12/06, ROLAND wrote:
>I am using FLEX and BISON to parse input given by the
>user.
>The input-line is picked up by FLEX correctly, since
>it gives som printf-statements of yytext.
>When yytext is processed by BISON on the other hand,
>yytext appears to be an empty string.
>Can someone tell me if there is something wrong in my
>code?

Flex does not return a string but a pointer to a buffer of a temporarily
'\0' terminated string.

So if you do not save the string in the buffer pointed at, after the next
Flex call, it will not exist anymore (and Flex may change the buffer).

Since you do not explain or give any explanatory code example, it is hard
to guess more than that.

  Hans Aberg





reply via email to

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