[stringtemplate-interest] StringTemplate type proxies

Terence Parr parrt at cs.usfca.edu
Sun Dec 12 21:18:21 PST 2010


So this is to prevent code pollution with stuff needed just for code gen?  It makes some sense, though I'm wondering how I've handled this in the past.  Probably I modify the model object to have the property.

Would this registering type thing be confused with registering attribute renderers?

Ter

On Dec 12, 2010, at 7:40 PM, Sam Harwell wrote:

> I recently started using StringTemplate for a significant code generation project. I’m quite happy with the way things are progressing, but I’m noticing there are several times where I have to add a new property to my code objects just so StringTemplate can produce the desired output. In a manner similar to attribute renderers, I believe the addition of type proxies would be extremely beneficial. Suppose the user registers a type proxy for type T. The type proxy exposes the following method:
>  
> object createProxy(object value);
>  
> Whenever an attribute resolves to a value of type T, the proxy’s createProxy() method is called. Attributes on the object are resolved against the value returned by the proxy.
>  
> Any thoughts on this?
>  
> Thanks,
> Sam
> _______________________________________________
> 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/20101212/7214a97f/attachment.html 


More information about the stringtemplate-interest mailing list