[stringtemplate-interest] Applying templates with more than one parameter to multi-valued attributes
Varghese
vcottagiri at zafinlabs.com
Tue Oct 31 09:49:37 PST 2006
Oops, a case of RTFM.
Sorry about that.
Thank you,
Varghese
Terence Parr wrote:
> On Oct 31, 2006, at 1:03 AM, Varghese wrote:
>
>
>> Hi Terence,
>>
>> There is an example template (scopedListingTest.st), test code
>> (ScopedListingTest.java), output as a part of the first post.
>> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2006-
>> October/000769.html
>> Or do you want a simpler test case?
>>
>> Also, if the template is such 'bFormatter(b, aDisplay, bIndex,
>> arg) ::= <<...>>'
>> and it is invoked like this '<a.bList:bFormatter(aDisplay=
>> {<a.display>}, bIndex={<i>}), arg={ABC}>'
>> Isn't 'b' a formal parameter(and hence don't have to be set
>> explicitly) because 'a.bList' is a array list of bs' and the
>> template is iterating through the list?
>>
>
> See section "Allowing enclosing attributes to pass through":
> When template x calls template y, the formal arguments of y hide any
> x arguments of the same because the formal parameters force you to
> define values. This prevents surprises and makes it easy to ensure
> any parameter value is empty unless you specifically set it for that
> template. ...
>
>
>
> Ter
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
>
>
>
More information about the stringtemplate-interest
mailing list