[stringtemplate-interest] 1, 2, and 3

Ed MacDonald edmacdonald at hotmail.com
Mon May 4 04:44:26 PDT 2009


Thanks Terence.  It appears trunc wasn't implemented in the C# port of
3.0.1. (The method is defined but returns null).

FYI...
Here is where I had been reading about first, last, and rest with no mention
of trunc:
http://www.antlr.org/wiki/display/ST/Expressions

I also see reference to a "tail" function, but no description of what it
does other than to say "tail of a single-valued attribute yields the same as
first, the attribute value".

-Ed



-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu] 
Sent: May-03-09 7:56 PM
To: Ed MacDonald
Cc: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest] 1, 2, and 3

that is a damn good question. normally we do the first one different  
not the last.  OH. trunc(foo). I am adding to the cheat sheet. ooop.s
Ter
On May 2, 2009, at 6:50 PM, Ed MacDonald wrote:

>
> I'm trying to figure out how to apply a different treatment to the  
> last element in a multi-valued attribute.  This seems like it would  
> be a pretty common use case, but I haven't been able to find how to  
> do it.  The first(), last(), and rest() family of functions seemed  
> like it would do the trick but unfortunately rest() includes last().
>
> So I can do this: 1 and 2, 3.
> But not this: 1, 2, and 3.
>
> Any suggestions?
>
> Thanks,
> -Ed
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest




More information about the stringtemplate-interest mailing list