[stringtemplate-interest] Help with recursive template application

Vincent Dupuis vincedupuis at hotmail.com
Mon Aug 24 12:16:11 PDT 2009


Ok, but why, if I reverse the parameters, the "iter.name" value passed is not good?

Like this:

    classDeclaration(iter, parent) ::= <<
    class <iter.name> : public <parent>
    {
        <iter.listOfSubClasses:classDeclaration(iter=it, parent=iter.name); separator="\n">
    }
    >>

I think there is something special with the first parameter and this behavior is not compatible
with recursive template application with more than one parameter.

vi


CC: stringtemplate-interest at antlr.org
From: parrt at cs.usfca.edu
To: vincedupuis at hotmail.com
Subject: Re: [stringtemplate-interest] Help with recursive template application
Date: Sun, 23 Aug 2009 13:01:37 -0700


On Aug 21, 2009, at 6:40 AM, Vincent Dupuis wrote:classDeclaration(iter, parent) ::= <<
class <iter.name> : public <parent>
{
    <iter.listOfSubClasses:classDeclaration(parent=iter.name, iter=it); separator="\n">
}
>>
I just remember. "it" is created in the ":" operation but is not yet available when the args are evaluated. so "it" in this case does not refer to the  listOfSubClasses:classDeclaration iteration.Ter
_________________________________________________________________
Attention à tous les Humains. Nous sommes vos photos. Libérez-nous de vos disques durs.
http://go.microsoft.com/?linkid=9666050
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090824/1f490286/attachment.html 


More information about the stringtemplate-interest mailing list