[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lex Help
From: |
John W. Millaway |
Subject: |
Re: Lex Help |
Date: |
Wed, 23 Jan 2002 15:39:09 -0800 (PST) |
> 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/
- Lex Help, Vijey Jenkal, 2002/01/23
- Re: Lex Help,
John W. Millaway <=