Hello,
I am trying to change some things in Actson JSON parser (
https://github.com/michel-kraemer/actson) which is itself based on JSON_checker (
http://www.json.org/JSON_checker/).
It is reactive parser which means that is parses next available piece of input data as long as it's available and maybe synchronously issues a parsed JSON event(s). This means that parser never blocks current thread waiting for new piece of input text.
Looking at code generated by Antlr I see that it uses some loops to pull data from input stream which apparently should block if subsequent yet unparsed part of input is not available. So this is not suitable if you want to release current thread while waiting for new data.
So the question is, can I use state machine generated by Antlr to somehow implement reactive parser? That is a parser that gets called with new piece of input stream and returns new parser state and maybe parse events (instead of calling input stream from parser as it is currently implemented in Antlr and most other parsers).