[stringtemplate-interest] Managing template parameters

Nathan Ward nward at resqsoft.com
Thu Nov 13 11:50:41 PST 2008


I'm aware of that, but how can I make a JUnit test for the subtemplate if it
uses an attribute that is not passed as a formal parameter? Hmmm, I guess I
can create a template inline in my test code that uses the template that I'm
testing, which is a string group template file. I'll try that. Thanks!

   Nathan 

-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu] 
Sent: Thursday, November 13, 2008 1:32 PM
To: Nathan Ward
Cc: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest] Managing template parameters


On Nov 13, 2008, at 9:32 AM, Nathan Ward wrote:

> Hello,
>
> Is the only mechanism to pass information to templates is via formal 
> parameters when using template group files?

They can see any attribute of any template enclosing. For example, if you
set the page name in the overall page template, any template embedded in
that page, no matter how deeply nested, can reference that attribute.
Ter




More information about the stringtemplate-interest mailing list