[antlr-interest] CharStream for unbounded input stream

Steve Drach drach at itsit.org
Wed Apr 28 15:47:18 PDT 2010


I'm reading data off a network interface.  Messages are distinct and come in bursts.  I've defined a grammar that can parse a message that doesn't depend on finding an EOF and it works when the messages are in a finite input stream, because eventually the stream is closed, but it doesn't work when I don't close the stream.  

My data is delivered via a java.io.Reader that returns either 0 characters when read or some finite number of characters that might not comprise a full message.  If the network connection is closed, it will also return -1.  However, in general the network connection is long lived and not closed.

I looked around in the mailing list for an appropriate CharStream implementation and didn't find one.  I thought I'd ask here before I embark on developing one.  Anybody have a pointer to something I can use?

Thanks
Steve


More information about the antlr-interest mailing list