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

Margaret Fieland madcapmaggie at yahoo.com
Tue Jun 8 15:09:33 PDT 2004


 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