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

Kyle Ferrio kferrio at gmail.com
Fri Mar 30 13:55:20 PDT 2012

Sure!  Have a look at this:


Things to look for -- in addition to the ability to keep grammars
action-free if you want to -- include the ability to handle direct
left-recursion (great for parsing algebraic expressions, propositional
calculi, *etc.*), decisively favoring parse trees over ASTs, and a
simple-yet-powerful listener model for processing trees.  Oh, and the
biggest thing of all -- Honey Badger (the code name for v4) is very robust
and will gobble up just about any grammar you give it.  If there's a
reasonable way to understand your grammar, Honey Badger does.

If you want to get deeper into it, Ter is hosting the work in github.  I
believe Ter's workign branch is at https://github.com/parrt/antlr4 and that
he periodically pushes to the "nominal" branch at


On Fri, Mar 30, 2012 at 1:40 PM, Ludwig Maes <ludwig.maes at gmail.com> wrote:

> Could you give a more specific pointer where I can find out more about
> the upcoming antlr 4.x?
> On 30 March 2012 18:09, Kyle Ferrio <kferrio at gmail.com> wrote:
> > I know you're asking about antlr3, and I see some answers.  This is just
> an
> > FYI: You're going to love ANTLR 4.
> >
> > The new antlr empowers you to keep separate grammar from actions (and
> > indeed keep separate grammar from target language).  Grammar reuse and
> > retargeting are integral to v4.  It's really beautiful.  Ter has posted
> > some examples and early access jars so that we can follow along at home.
> >
> > (Check out Ter's blog/wiki at antlr.org.)
> >
> > Kyle
> >  On Mar 30, 2012 3:37 AM, "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.
> >>
> >> Thank you
> >> Nikolay
> >>
> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> >> Unsubscribe:
> >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> >>
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address

More information about the antlr-interest mailing list