[antlr-interest] template rewrites
Steve Ebersole
steve at hibernate.org
Thu Apr 30 09:23:58 PDT 2009
Ok, now that my email is supposedly yet again fixed I'll try sending
this again :)
On Wed, 2009-04-29 at 18:43 -0500, Steve Ebersole wrote:
> I am trying to develop a grammar which uses StringTemplate for its
> rendering. But I find something rather annoying and wanted to see if I
> am just missing something. Basically I have a bunch of rules which call
> other rules; the "top" rule is just to group like rules together. For
> example:
>
> function
> : castFunction
> | trimFunction
> ...
> ;
>
> All the rules under function return StringTemplates. Yet in order to
> get any output, I need to do the following:
>
> function
> : castFunction -> {$castFunction.st}
> | trimFunction -> {$trimFunction.st}
> ...
> ;
>
> Which seems redundant to me. Is there something I am missing?
>
--
Steve Ebersole <steve at hibernate.org>
Hibernate.org
More information about the antlr-interest
mailing list