[stringtemplate-interest] Attribute not found exception?
Koen Van Exem
koen at allors.com
Thu Mar 30 22:26:41 PST 2006
Hello Terence,
We have been using different tools over the years for our code generator.
We started off like most people by using print statements in our code.
The next step in the evolution was dumping our meta domain in an XML
file and using XSLT to generate to code.
One advantage of this approach was the we also used what you call
'template application' (Lisp's Map or XLTS' push model).
The major drawback was that you need to know XSLT.
Because of readability and maintainability we switched to Velocity.
Velocity was chosen because one of our non-functional requirements was
that it should be available for Java and .Net.
Velocity served us well until we hit the 'recursion' wall ...
In Velocity parameters are always allocated globally, so there is no
sensible way to achieve recursion.
There now is an unofficial workaround using #local() but it is not
available on the .Net port (Nvelocity).
So, I started looking for an alternative and found StringTemplate!
We just completed the port to StringTemplate and I must say that we had
to introduce some 'boolean' attributes in our domain
but the resulting templates are far more concise and readable.
What we noticed is that the templates now look a lot like our former
XSLT templates,
with one big difference that they're not XSLT ;-)
If you should ever change the name of StringTemplate then I suggest
ReverseParser, BackwardsParser or Resrap !
I think this describes it best, it is a Parser used backwards ...
The most important thing StringTemplate misses right now is some
tooling, like editor support.
Maybe I'll write an editor for Eclipse, what is actually not that
difficult to do.
But first we have to release Allors 1.0 ...
Anyway thanks for the tool,
Koen
Terence Parr wrote:
>
> On Mar 28, 2006, at 3:22 AM, Koen Van Exem wrote:
>>
>> PS: I meant 'piece' of software, although it actually gave me some
>> 'peace' of mind when switching from Velocity ;-)
>
> What didn't you like about Velocity? How did you find ST?
>
> Ter
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list