30 Sep
2019
30 Sep
'19
4:23 p.m.
On 9/30/19 12:14 PM, julien.blanc@tgcm.eu wrote:
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.
Vinicius has an HTTP pull parser here: https://github.com/BoostGSoC14/boost.http
Pull parsers can also be built on top of push parsers, although it is less easy.
Indeed, that is how we implemented XmlTextReader in libxml2, and it was a rather painful experience. Coroutines can help, as Phil pointed out, but pull parser are also a natural fit for parser combinators (e.g. HTTP contains a partial URL syntax, so it could be created combining HTTP and URL pull parsers.) I am not sure how well coroutines would handle this case.