[stringtemplate-interest] "push" methods for the "pull template" recovering addict.

Terence Parr parrt at cs.usfca.edu
Wed Apr 18 12:57:16 PDT 2007


On Apr 4, 2007, at 8:35 PM, Jorge Vargas wrote:

> Hi
>
> first of all I'll like to thank you guys, I have to admit I got into
> stringtemplate because I need "just another template engine" and since
> this project is java I figure that if it was ported to python it
> should be good :p. Then after reading some of the documents on the
> site I notice how different it is and I'm liking it a lot.

Hi Jorge.  Welcome.

hooray!  Glad you like it.

> Although I'm puzzle by the following situation: I know I know this is
> wrong but what I want to do, in so mytical templating engine, will be
> something like this:
>
> #foreach( $line in $accounts )
>    $n.desc     $n.quantity      #n.total
> #end
>
> note the whitespace, I do need them and they must be fix,  
> (requirement)

Ok, no problem.

<accounts:{ n |
    <n.desc>     <n.quantity>      <n.total>
}>

>
> after much digging I find out in this PDF
> http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf (sidenote:
> great document, is there a more cpu friendly version of it?)

Is a really slow to render? strange.  Well, perhaps print it out.

> and in page 9, item 9.1 to be exact it finally gives me a way of how
> to implement what I need without using pull methods.
>
> my point is that this type of construct is very common, in fact is the
> second thing most engines show in their tutorials, and that is where
> the subject of this emails comes in, why not have an article/wiki
> page/documentation with a brief translation of the common pull methods
> to stringtemplates push idioms, I believe this will help new people
> get involve into using the project faster which will end up in a
> better wider spread of the engine.

How about adding one? that would be great.  You can sign up for an  
account here:

http://www.antlr.org/wiki/signup.action

> ones again thanks for this great software it's nice to see good,
> profound theory backed code.

thanks! I really appreciate the feedback.  Thank you.

Ter



More information about the stringtemplate-interest mailing list