help-flex
[Top][All Lists]
Advanced

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

Re: Lex Help


From: Nikos Balkanas
Subject: Re: Lex Help
Date: Wed, 23 Jan 2002 21:34:08 +0200

Hi Vijey,

Just to clarify what John is asking:

To post the debugger output compile with the -d option:

flex -d ...

Capture that to a file (script?). Chop 50 lines above and below the problem
and post that along with the code.
You can also get down and dirty with gdb if you don't feel squirmish about
C. Get the flex generated file (program.c?), and remove using an editor, all
the #line directives. Now you can debug it like a regular C file.

I am not aware of buffer overflows in flex.

Nikos

----- Original Message -----
From: John W. Millaway <address@hidden>
To: Vijey Jenkal <address@hidden>; <address@hidden>
Sent: Thursday, January 24, 2002 1:39 AM
Subject: Re: Lex Help


> > The problem itself is that I send data to a remote host in the form of
> > tokens. At the other end of the socket the fd is redirected to yyin and
> > the lex builds a string out of the token until a } is received. The
string
> > can get as long as 1938 bytes. The string is then parsed using Yacc.
> >
> > If, however the string length goes beyond this length (1939 byte), the
lex
> > engine goes into a weird state and is not able to analyse any more.
>
> It sounds all ass-backwards to me. lex should be taking a string a
spitting out
> tokens, not the other way around. In any case, here are some speculations:
>
> You have a buffer overflow. It may be due to a misunderstanding over
yytext.
> You can't modifiy yytext, you must copy it to preserve data between calls
to
> yylex(). Are you using lex or flex? Did you run it through a debugger?
Post the
> source code, otherwise we can't be of much help.
>
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> _______________________________________________
> Help-flex mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-flex
>
>




reply via email to

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