[stringtemplate-interest] StringTemplate type proxies
Sam Harwell
sharwell at pixelminegames.com
Mon Dec 13 05:49:45 PST 2010
I actually think "register" makes it less confusing, especially since the
parameter is an interface which clearly differs from the AttributeRenderer
interface.
Sam
From: Terence Parr [mailto:parrt at cs.usfca.edu]
Sent: Sunday, December 12, 2010 11:18 PM
To: Sam Harwell
Cc: stringtemplate-interest
Subject: Re: [stringtemplate-interest] StringTemplate type proxies
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/20101213/69610aa3/attachment.html
More information about the stringtemplate-interest
mailing list