Hi all,

Is there any reason why I should consider recycling lexers and parsers in
preference to creating new instances on demand?

For example, should I consider doing this:

    existingLexer.Reser();
    existingLexer.CharStream = charStream;

instead of this:

    new MyGrammarLexer(charStream);


And should I do this:

    existingParser.Reset();
    existingParser.TokenStream = tokenStream

instead of this:

    new MyGrammarParser(tokenStream)


Are parsers and lexers especially heavyweight at all?  If the answer depends
on the context, then I should point out that I'm using the C# runtime, and
parsing many different input strings.


Thanks,

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to