[stringtemplate-interest] Help with recursive template application

Vincent Dupuis vincedupuis at hotmail.com
Wed Aug 19 18:28:26 PDT 2009


Hi,

I'm trying to pass a "parent" value in a recursive template application
but without success. Here are my templates:

group templates;

mainTemplate(listOfClasses) ::= <<
<listOfClasses:classDeclaration("TopClass"); separator="\n">
>>

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

Considering A, B, and C classes are TopClass and that BB class is an inner class of B.

and the output is...

class A : public TopClass
{
}
class B : public TopClass
{
    class BB : public BB
    {
    }
}
class C : public TopClass
{
}


Why I don't get the right value for class BB ?
Like:

    class BB : public B
    {
    }


Somebody knows why?

Thanks,

Vince


_________________________________________________________________
Créez un personnage à votre image pour votre WL Messenger
http://go.microsoft.com/?linkid=9656622
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090819/63d17e0a/attachment.html 


More information about the stringtemplate-interest mailing list