[antlr-interest] Composite Tree Grammars are things of beauty, but ...

Gary Miller miller.garym at gmail.com
Wed Mar 9 19:15:07 PST 2011


Hey Terrance,

tree grammar T;
a : some horrible mess of a RECURSIVE rule;
b : B ;

tree grammar U;
import T;
a : {pre action} T.a {post action}; // <-- wants to be able to refer
to super rule

It wouldn't be enough to just expose the super rule T.a.
In the generated walker A_T the rule 'a' would need to call the delegators.a().

> ANTLR technically doesn't expose x.y syntax to the user and so I didn't recognize the fact that you invoked the super rule.  It extracted only those rules from your super grammar that it needed. It does this so that you can fill up libraries of grammars with rules and then pick out which ones you want without bloating your generated code.

Thanks for raising the issue.
Based on my bias ("Composite Tree Grammars are things of beauty") I
would hope for more than a minor ;-)
How do I get a login the JIRA so that I can follow issues?

> That said, I am adding an improvement request for consideration.
>
> http://www.antlr.org/jira/browse/ANTLR-452

Sorry, I can't parse this. Are you saying that you would like to
removed imports from ANTLR?

> I'd like to retract or how ANTLR it handles imports anyway.

Regards
Gary

P.S. is there any reason for ANTLR over Antlr | AntLR | AntLr | antlr etc.


More information about the antlr-interest mailing list