[antlr-interest] Re: parser/lexer invocation: performance/optimization question

lgcraymer lgc at mail1.jpl.nasa.gov
Tue Jun 8 15:29:11 PDT 2004


I have an InputBuffer class for this which will be released with 2.8
(whenever I can get approval).  I'll upload the source to the files
area when I get the chance.

--Loring


--- In antlr-interest at yahoogroups.com, "Margaret Fieland"
<madcapmaggie at y...> wrote:
>  I have a parser/lexer that is repeatedly invoked to parse a
> succession of strings.
> 
> The current implementation is that the application invokes a routine
> that does something like:
> 
> string source("Your input text");
> istringstream str(source);
> 
> MyLexer lexer(str);
> MyParser parser(lexer);
>  ... initializeASTFactory
>  ... setASTFactory
> 
> This routine is invoked literally thousands of times.
> 
> I'd like to be able to the setup (above) once in a constructor and
> just invoke the parser multiple times on the strings as I would like
> to avoid the overhead in the initialization.  
> 
> Is there any way to do this?  Nothing I've tried so far has worked.
> 
> Thanks.
> 
> Peggy



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list