[stringtemplate-interest] Looking for the 'right' way to split
lines
Hill, Robert
rhill03 at eds.com
Wed Jan 18 02:52:20 PST 2006
Wouldn't this be a good task for a derived AttributeRenderer?
You could intelligently split the lines at column 80 , or for example
the closest comma to column 80 by creating a CodeLineRenderer or
something?
There's an example for rendering dates in the 2.2 release notes, it
seems pretty straight forward.
Cheers,
/2ob
--
Rob Hill
EDS - Hallamshire Business Park
F1E/087
Sheffield
T: +44 (0) 114 291 1928
M: +44 (0) 791 732 1227
E: rhill03 at eds.com
>-----Original Message-----
>From: stringtemplate-interest-bounces at antlr.org
>[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf
>Of VAUCHER Laurent
>Sent: 18 January 2006 10:40
>To: stringtemplate-interest
>Subject: [stringtemplate-interest] Looking for the 'right' way
>to split lines
>
> Hi.
>
> I'm using stringtemplate to generate Java source code, and,
>as far as possible, I'd like the generated code to conform to
>our current coding standards. The question I have is about
>splitting lines. I think it should be the responsibility of
>the view part (templates) to split lines, but how could I do it?
>
> The simple example is when having a collection of values
>that should be output as an array litteral. Is it possible to
>express conditionnal line splitting like: "insert a newline if
>we've reached column 80"?
>
>
>Laurent.
>_______________________________________________
>stringtemplate-interest mailing list
>stringtemplate-interest at antlr.org
>http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
More information about the stringtemplate-interest
mailing list