Re: [Qemu-devel] [PATCH 33/56] json: Redesign the callback to consume JSON values

2018-08-13 Thread Eric Blake
On 08/08/2018 07:03 AM, Markus Armbruster wrote: Observations: 1. This is not the only way to use recursive descent. If we replaced "get next token" by a coroutine yield, we could do without a streamer. 2. The lexer reports errors by passing a JSON_ERROR token to the streamer. T

[Qemu-devel] [PATCH 33/56] json: Redesign the callback to consume JSON values

2018-08-08 Thread Markus Armbruster
The classical way to structure parser and lexer is to have the client call the parser to get an abstract syntax tree, the parser call the lexer to get the next token, and the lexer call some function to get input characters. Another way to structure them would be to have the client feed characters