Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2019-09-30 22:27:02


On 30/09/2019 23:14, Julien BLANC wrote:
> "Bjorn Reese" – 29 septembre 2019 12:56
>> That is, push parsers are easily build on top of pull parsers.
>
> Do you have an example of an efficient implementation of a pull parser on top of async io ? I find push parsers really more straightforward in that case.

Usually that requires the ReadNextToken call (whatever its name) to be
async as well (whether that's via callbacks, futures, coroutines, or
some other async framework).

Failing that, it would have to return some special error code that means
"I need more input".

Usually (outside of a proper async framework) the caller pulling tokens
from the parser is directly responsible for feeding it new input as well.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk