[antlr-interest] Optimizations for CSharp3 target with large grammars and output=AST

Sam Harwell sharwell at pixelminegames.com
Sat Aug 6 16:51:25 PDT 2011


Hello everyone,

 

I'm working on codegen optimization for grammars with output=AST. Medium to
large grammars should see a significant improvement in the way local
variables are handled in rules, *especially* when rewrite operators are
used.

 

Since this is currently an experimental optimization, I'd prefer the initial
testers be advanced users familiar with both the creation/usage of grammars
and the C# code generated by ANTLR. If you have a grammar which would
particularly benefit from this and want to help test this version, let me
know and I'll send you information about the preview release. Here is a
summary of some the optimizations included:

 

.         Label aliasing where possible for both tokens and rule return
values.

.         Removal of Rewrite*Stream variables which are not actually
referenced by a rule's rewrite blocks.

.         Removal of local variables for tokens and rules which are not
referenced in an action and either aren't in the rewrite rule or have a
bang(!) operator.

 

Thanks,

Sam



More information about the antlr-interest mailing list