[stringtemplate-interest] sequences and unique numbers

Sam Barnett-Cormack s.barnett-cormack at lancaster.ac.uk
Tue Aug 4 04:17:46 PDT 2009


Terence Parr wrote:

> The problem is that we get something like end1 and end2 instead of the  
> same label. The solution is to compute a value and hold it for the  
> duration of the template, which we can do as a default argument:
> 
> if(cond, block, label={end<(uniq)>}) ::= <<
> 	<cond>
> 	brf <label>
> 	<block>
> <label>:
>  >>

Also, it would be nice to have some syntactic sugar for that...

-- 
Sam Barnett-Cormack


More information about the stringtemplate-interest mailing list