[antlr-interest] parsing InputStream from a socket

Sean Proctor sproctor at gmail.com
Wed Aug 22 16:59:24 PDT 2007


Hello,

I'm tasked with parsing a protocol that resembles XML. I was using a SAX
parser and fixing up the input to be valid XML. I switched from this to an
ANTLR lexer/parser that handles the data as it comes in. I can't figure out
how to get ANTLR to start parsing as soon as it has enough data to determine
what to do. I tried writing a CharStream that would serve this purpose, but
it seems that the tokenizer wants to keep going until the EOF. I haven't
spent too much time on it to determine if this is necessarily true, but I
think it's a good assumption. So my questions are: Does anyone have any
pointers on how to implement a tokenizer that will exhibit the behavior that
I desire? If I do that, will the parser do anything before it gets an EOF?
Are there any SAX implementations written in ANTLR that I could adapt or use
for reference?

Thanks,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070822/05e6d0a8/attachment.html 


More information about the antlr-interest mailing list