Re: How to use flex/bison with an inverted flow of control?



DoDi wrote:

> Bob wrote:

>> Instead of bison asking for the tokens, I would like to give it one
>> token at a time, and have it tell me when it's done. That way, I can
>> give it data as it arrives to me. Are there any reliable open source
>> projects out there that work like this?

> You want a "reversed" parser logic, where the input module calls the
> lexer, which in turn calls the parser...?

> An interesting idea, but perhaps a bit away from the main stream
> development.

You might want to look at the LEMON parser generator, which is
designed for precisely that control flow model:

<http://www.hwaci.com/sw/lemon/index.html>

I can't vouch for its reliability, but it's certainly open source (public
domain, in fact).
.