[antlr-interest] A way to reuser Lexer, Parser and TreeWalker instances?

mzukowski at yci.com mzukowski at yci.com
Thu Apr 17 08:26:19 PDT 2003


I believe everything uses an InputState object to hold state.  That needs
reset and you can reuse your lexer, parser or tree parser.  You are
responsible for handling any instance variables you introduce.

Monty

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam at yahoo.com]
Sent: Thursday, April 17, 2003 7:08 AM
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] A way to reuser Lexer, Parser and
TreeWalker instances?


Actually, once you've changed the text of the lexer,
you should be able to reinvoke the parser rule with no
complications.  Don't know about the TreeWalker.

-Matt

--- oneway_111 <oneway_111 at yahoo.com> wrote:
> Hi,
> 
> Is there a way to reuser Lexer, Parser and
> TreeWalker instances
> between invocations?
> 
> With Lexer it perhaps could be done with
> Lexer.setText() but it
> appears to be more tricky for Parser and TreeWalker.
> 
> Any ideas? Thanks
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> 
> 


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list