help-flex
[Top][All Lists]
Advanced

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

inverted flex interface


From: Bob Rossi
Subject: inverted flex interface
Date: Wed, 14 Dec 2005 22:10:48 -0500
User-agent: Mutt/1.5.9i

Hi All,

Thanks for such a wonderful tool!

I'm trying to understand if flex provides an inverted flow-of-control
interface that would support using it in an asynchronous mode.

Basically, I don't have all the data that flex needs up front. So, I'd
like to call yylex() whenever input arrives to me. 

Basically, I'd like to call yylex () and have it process as much as it can 
from a buffer in memory. Currently I'm using the `yy_scan_string()' variable. 
However, when yylex () determines that the input is exhausted I would
like it to return, and wait until I call yylex () again so that it can
continue parsing where it left off. Is this possible?

Combining that functionality with the lemon parser
(http://www.hwaci.com/sw/lemon/lemon.html), I should be able to build a
complete asynchronous parser.

As data becomes available to me, I can send it to flex. As flex
determines a token is ready, I can send it to the lemon parser. When the
lemon parser determines a parse tree is ready, it will alert me and I
can handle it. Apparently bison doesn't handle this kind of control
flow. Any other suggestions would be appreciated.

Thanks,
Bob Rossi




reply via email to

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