Re: [idea] Re-startable "incremental" Spirit Parser Generator?

"Hartmut Kaiser" <[email protected]> Sat, 6 Nov 2010 09:08:33 -0500
Newsgroups gmane.comp.parsers.spirit.devel
Message-ID <[email protected]>
> I just have a question: has there been thought put into creating a re-
> startable "state-ful" parser? This type of parser is generally useful in
> implementing an asynchronous parsing model -- i.e. in network
> applications.
> 
> I've recently had to implement my own re-startable parser that is just a
> whole big switch statement. I know there is a multi_pass_iterator, but the
> read operation in the underlying stream actually blocks -- using that in a
> high performance / throughput environment doesn't really make sense.
> 
> The solution I came up with was to have a separate protocol-specific
> incremental parser, that then once it's parsed a chunk that has its own
> structure, I then have a spirit-qi generated parser that deals with the
> turning of the string into actual data structures.
> 
> It would be great if we were able to create function objects from spirit
> parsers that had its own state and could deal with the semantic actions as
> they come. A tribool would indicate whether the parsing is done (true), in
> progress (indeterminate), or has failed (false).
> 
> Any insight into this would be greatly appreciated.
> 
> Have a good one everyone and I hope to hear your thoughts about this. :)

See here for an idea which might give us a solution:

http://article.gmane.org/gmane.comp.parsers.spirit.general/14413

Regards Hartmut
---------------
http://boost-spirit.com




------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev