[stringtemplate-interest] i0 access in <attribute:template(argument-list)> in ST4
Damien Urruty
lepilache at hotmail.com
Thu May 19 07:18:19 PDT 2011
HiWhy is the i0 not accessible in the case I mentionned ? Is there a special reason for this ? I think it would be logical, and practical to have it.
Subject: Re: [stringtemplate-interest] i0 access in <attribute:template(argument-list)> in ST4
From: ub at abego-software.de
Date: Thu, 12 May 2011 11:32:27 +0200
CC: stringtemplate-interest at antlr.org
To: lepilache at hotmail.com
Hi,
you may wrap the call into an anonymous template.
Here a complete example:
========main(p) ::= "<p:{a|<f(a,i0)>}>"
f(s,index) ::= "<index>. <s><\n>"========
Calling main with a list ["X","Y","Z"] will render========0. X1. Y2. Z
========
I assume in your case this should work:
<attr.attr2:{p|<mytempl(position=i0)>}>
BTW: if mytempl only has one parameter ("position") you may omit the parameter name and just pass i0:
<attr.attr2:{p|<mytempl(i0)>}>
Udo
On 12.05.2011, at 10:22, Damien Urruty wrote:Hello,
I want to access the i0 value in my argument-list like this :
<attr.attr2:mytempl(position=i0)>
But this raises me an error : implicitly-defined attribute i0 not visible.
Is this normal or is it a bug ?
I am trying to migrate from v3 to v4, and I have found problems in auto-indentation too, but for the moment I can't give an example of what fails.
Thanks for the response !_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110519/0336a09f/attachment.html
More information about the stringtemplate-interest
mailing list