[antlr-interest] How to use inline templating with the StringTemplate interface
Imre András
iar73 at freemail.hu
Sat Dec 6 13:50:54 PST 2008
It works, thanks!
András
Jared Bunting <jared.bunting at peachjean.com> írta:
> assignment : leftValue DEFINES rightValue ->
> template(left={$leftValue.text}, right={$rightValue.text}) "content of
> template here";
>
> should work... (the use of "template" instead of the template name is
> key...)
>
> -Jared
>
> Imre András wrote:
> > Hi,
> >
> > I'm checking out the templating output feature of Antlr. I started
> > with CMinus.g grammar found in examples-v3.tar.gz. Based on this
> > grammar I created another one, which call templates defined in an
> > external stg file. For example my assignment rule is:
> >
> > assignment : leftValue DEFINES rightValue ->
> > assignment(left={$leftValue.text}, right={$rightValue.text});
> >
> > As my grammar is quite simple, I'd like to get rid of the external
> > file. Is there a way I can do all the templating inline?
> >
> >
> > Thanks,
> > András
> > ------------------------------------------------------------------------
> >
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081206/18936282/attachment.html
More information about the antlr-interest
mailing list