[stringtemplate-interest] added length, strip operators to ST

Terence Parr parrt at cs.usfca.edu
Mon Jul 24 17:57:21 PDT 2006


Hi,

Kay Roepke needed length() operator for obj-c output of ANTLR.  Added:

07-24-2006

o added length(attribute) thanks to Kay Roepke.  For now it does not
work on strings; it works on attributes so length("foo") is 1 meaning
1 attribute.  Nulls are counted in lists so a list of 300 nulls is
length 300.  If you don't want to count nulls, use
length(strip(list)).

o added strip(attribute) that returns an iterator that
skips any null values.  strip(x)=x when x is a single-valued
attribute.  Added StripIterator to handle this.

Ter


More information about the stringtemplate-interest mailing list