[antlr-interest] Unfolding of loops with antlr?

Randall R Schulz rschulz at sonic.net
Sat Dec 22 07:17:13 PST 2007


On Saturday 22 December 2007 00:41, Harald M. Müller wrote:
> Hi -
>
> ...
>
> Second, there is no reason to rewriting with ANTLR rewrite rules; in
> some instances, a custom rewriter (which can even ignore much of the
> grammar) is faster to write than a complete tree grammar - don't fall
> to the "I have a hammer (=ANTLR), it must be a nail!" fallacy.
> Especially for local changes ("peephole optimization"/"peephole
> rewriting"), where the effects need no knowledge about the
> surrounding, this may yield more fine-granular and stable software,
> because changes in other places of the (tree) structure/grammar will
> not affect the local change rule at all.

I have tree rewriting requirements (not essentially connected to a 
parsing task though it does occur downstream of an ANTLR parser) and 
have found that Tom works well for these purposes.

<http://tom.loria.fr/>


> ...
>
> Regards
> Harald M.


Randall Schulz


More information about the antlr-interest mailing list