[stringtemplate-interest] Fwd: How best to do recursive hetero template calls?
Gerald Rosenberg
gerald at certiv.net
Thu Feb 18 09:09:56 PST 2010
Hi Ter,
Recursive hetero template calls (given /node.type/ is the literal name
of a template):
TypeA(node) ::= <<
// Prefix code for <node.type>
...
<node.children:{ node | <(node.type)(node)> }>
// Suffix code for <node.type>
...
>>
While it works well, turns out practical use is somewhat limited in that
it renders as just one big blob of code|text.
Wonder if any thought has been given to allowing ST to render to a
string array, maybe using some template level flag to mark when to
switch to generating to a new array slot? Would add flexibility in the
subsequent stitching together of the content.
Best,
Gerald
On 2/16/2010 2:49 PM, Gerald Rosenberg wrote:
> Hi Ter,
>
> Yes, slippery slope and all that. Quite agree with the argument against
> model view entanglement -- actually the argument is mostly against
> putting combinatorial logic in the view to evaluate model aspects.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20100218/0810342c/attachment.html
More information about the stringtemplate-interest
mailing list