On Sep 25, 2009, at 4:32 AM, John851 wrote:
> Hello,
>
> I try to use StringTemplate to write a simple codegen.
>
> Can I use nested ST templates in my .stg file?
> Smth. like this:
> //---------------------------------------
> group ANTLRLangCodGen;
>
> dictdef()::="dict([<element; separator=",">])"
>
> element()::="<cell; separator=",">"
>
> cell(axis,value)::="(<axis; separator=",">),<value>"
> //---------------------------------------
>
> Where "element" and "cell" are nested templates.
when you reference cell, it looks for attribute called cell not a
template. cell() does that.
> And other question:
> How to load a .stg file and use templates in my tree grammar in
> ANTLRworks ?
AW 1.3b I think allows you to specify what the test rig looks like;
otherwise you can't really tell it how to load the template group. do
remote debugging instead of trying to launch the debugger directly
from AW.
> And how to pass plain string argument's value to template? Is it
> possible only via labels like in the following example?
>
> rule1: $var1=WORLD -> SayHello(word={$var1.text});
-> foo(arg={"blah"}
Ter
>
> Thank you
>
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---