[antlr-interest] Using a single parser instance to process multiple blocks of data.

troy runkel trunkel at gmail.com
Mon Sep 24 14:01:21 PDT 2007


Greetings,

I'm working on a parser based on the C target that will eventually get
its input from a network API.  I'd like to be able to create an
instance of the parser, call the network API to fetch the next block
of data, parse that data and then continue fetching/parsing blocks of
data.

Once I've setup the inputstream -> lexer -> tokenstream -> parser
relationship, and parsed all the data currently in the inputstream, is
there a way to tell the inputstream that more data is available?  Do I
need to create a new inputstream for each block of data?

Is there a better way to do what I have in mind?  Thanks.

Troy Runkel


More information about the antlr-interest mailing list