[antlr-interest] Stripping actions and tree commands out of a grammar

Bart Kiers bkiers at gmail.com
Fri Mar 30 04:16:35 PDT 2012


On Fri, Mar 30, 2012 at 12:37 PM, Nikolay Ognyanov <
nikolay.ognyanov at travelstoremaker.com> wrote:

> Can somebody please advise whether there is a way/tool to automatically
> strip out of an ANTLR grammar all actions and tree comands? A pure
> grammar with these parts stripped is useful for documentation and
> presentation purposes. It is my feeling too that it would be useful to
> have a clear view of the uncluttered grammar during the process of
> development of a new language.
>

You can use the org.antlr.tool.Strip class for this:

java -cp antlr-3.X.jar org.antlr.tool.Strip T.g

Regards,

Bart.


More information about the antlr-interest mailing list