[antlr-interest] Parsing multiple messages using one parser

Ric Klaren ric.klaren at gmail.com
Tue Feb 7 06:33:08 PST 2006


On 2/7/06, Jens Stegemann <jens.stegemann at gmx.de> wrote:
> Is it possible to use the same myParser and myLexer objects in every call of
> do Parse(...) and can you tell me how I have to initialize them in the
> constructor and use them in doParse(...) to do so?

Yes, you should be able to dig up multiple posts from the mailinglist
archive send by me with instructions to do this. You have to use the
more explicit constructors from lexer and parser. The baseclasses for
lexer/parser/inputbuffer have some methods to reset/initialize stuff
for a new stream.

If you can't find it bother me again and I'll try and dig some example
snippets up. (Very swamped with work currently)

Cheers,

Ric


More information about the antlr-interest mailing list