[antlr-interest] Re: parser/lexer invocation: performance/optimization question
lgc at mail1.jpl.nasa.gov
Wed Jun 9 01:59:49 PDT 2004
Ok, I uploaded "reset.zip" which contains a resettable InputBuffer
class and a Test class that demonstrates how it is used, along with a
"main" which sets up. This is not a complete package; replace the
ANTLR distribution version of the InputBuffer files and use the others
as an example of use.
--- 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.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest