[stringtemplate-interest] List of used Attributes from ST without formal parameters
Terence Parr
parrt at cs.usfca.edu
Sun Apr 22 18:05:19 PDT 2007
On Feb 27, 2007, at 10:59 PM, Dreyer Ulf (CR/APA3) wrote:
> Right now I'm thinking of restricting the use of anonymous
> templates in my Application.
> This brings me to a quick question:
> I'm trying to use ST to support a VERY easy template mechanism in
> one of
> our applications. It has to be very simple as nobody of the users
> will
> write anything as complex as <mylist:{i | something <i.foo> =
> some more <i.bar>}>
> So I'm thinking of removing(= not using) all anonymous Templates.
> There will still be Template application like <myList:TemplateA()
> > or <TemplateB(myList)>
> but nothing fancy.
>
> This shouldn't reduce the power of ST right (only some
> convenience for experienced users)?
Yes the two are identical. A closure-like anonymous template is
just an unnamed template; otherwise they are the same. well you can't
recurse because you don't know the name. ;)
> I will probably also disallow the <(expr)(argument-List)> and
> <attribute.(expr)> constructs.
> This WILL reduce the power of ST but I don't think these
> constructs are necessary for what we need
> and they are way to complicated.
Yes, I don't think you really need those.
> With these restrictions it will be a lot easier to deduce which
> variables/symbols are used in a
> given Template and its subtemplates.
>
> Is there any mayor flaw in this argumentation?
No, you can do what you want without those features, it is just more
of a hassle. :)
Ter
More information about the stringtemplate-interest
mailing list