Is it possible to create a Pull Parser using Irony?

Apr 17, 2011 at 9:35 AM

Is it possible to create a pull parser like XMLReader using Irony? If it is possible then how to achieve it?

Apr 20, 2011 at 4:11 PM

My guess would be that you would need three layers:

(1) Tokenize your input stream using Irony

(2) Produce an AST using Irony

(3) Provide a Pull API (e.g. GetElements()) on top of the AST to clients

Mohamed

Apr 20, 2011 at 6:38 PM

If I create the parser by following these steps, then I think it will not serve the purpose of pull parsing. If I consume the whole input stream first and then create AST from it, then there is no point of creating a pull parser. I want to create a pull parser using Irony where in I can control the parsing, like the XmlReader does. It does not consume the whole input xml stream, it continues with parsing treating the document as a series of items which are read in sequence using the Iterator design pattern under your full control, you don't have to parse the whole xml at once.