[antlr-interest] StringTemplate: help on global dynamically scoped attribute/value/parameter

Terence Parr parrt at cs.usfca.edu
Mon Aug 13 12:40:52 PDT 2012


Hi, to make a "global" just create an attribute in the outermost template. That, through dynamic scoping, any template that is embedded within that template will see that outermost attribute. For example, when I am generating a file I usually have a fileName attribute at the outermost level in file() template. then, and I stick inside like method() can access that fileName attribute with <fileName>.
T
On Aug 13, 2012, at 5:52 AM, Francis ANDRE wrote:

> Hi
> 
> I am concerned about defining/using global dynamic scope attributes in ST. 
> Beside reading the documentation, I did not found anything that is closed to 
> this concept.
> 
> Can someone confirm that there is no global attribute statically or dynamically 
> scoped?
> 
> TIA
> 
> FA
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list