[stringtemplate-interest] Separator definition

Terence Parr parrt at cs.usfca.edu
Wed May 25 16:35:14 PDT 2005


On May 25, 2005, at 10:19 AM, jobapply wrote:
>>> Only the way I see is to point at another template in "separator"...
>>> But such template must be declared separately from the main body,
>>> while it
>>> should be inlined in fact,
>>> so that way will not do...
>>>
>>> Any nice inlining solution ?
>>>
>>
>> I was just informed that while separator=template() works separator=
>> {...} does not!  I'm fixing in next release.
>>
>
> May I finish..? May I finish ... ?
>
> Separator={...} is UGLY for large separating template blocks...  
> Another way?
>
> Ok, I'm finished.

Hmm...well, a special two-dimensional iterator would make doing multi- 
column tables easier.  Right now I only have the notion of walking a  
list of attributes linearly.  What if we allowed a rowsize or  
something that influenced the ':' apply operator.  Also what about  
using the comma operator?  For example, here is how we do a 3-column  
table:

<table>
<tr>
$pictures:col(), col(), col(), endrow()$
</tr>
</table>

where endrow() would be <\tr><tr> or something.  The only thing is  
that you can't handle unfinished rows.  For example if you have 4  
pictures then the last two columns in the 2nd row would be blank..not  
sure how to handle that properly.

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com



More information about the stringtemplate-interest mailing list