[antlr-interest] parser resuse
Terence Parr
parrt at jguru.com
Thu Jan 24 09:50:10 PST 2002
On Thursday, January 24, 2002, at 08:03 AM, gidadoifiok wrote:
> I search on 'parser reuse' and came up with these two messages:
>
> http://groups.yahoo.com/group/antlr-interest/message/4590
> http://groups.yahoo.com/group/antlr-interest/message/4176
>
> Which did not seem to apply. But my guess is that I can do
> something like this:
>
> TransformScanner ts =
> new TransformScanner(transform); // my derived lexer
> TokenBuffer tb = new TokenBuffer(ts);
> parser.setTokenBuffer(tb); // user previously constructer parser
> parser.rewind(); // probably don't need to do this?
>
> I will put this in a synchronized method to insure thread-safety.
> Is this the way to do it, or is there a correct way?
In 2.7.2 you'll see new reset() methods for the various state
objects...can you take a look at those?
Ter
--
Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list