[Acceleo] Code Beautifying [message #484528] |
Tue, 08 September 2009 06:57 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Hey,
just started yesterday my first steps with Acceleo. I've some general
questions concerning the beautification of the generated code.
1. Is there a common rule for indentation? When i write my templates
with normal indentation, like this
[file (testContext.name.concat('.ttcn3'), false)]
module [testContext.name/]{
[for (dPool : DataPool | testContext.allDataPool)]
[for (dp:DataPartition|dPool.ownedPartition)]
[genTypes(dp)/]
[/for]
[/for]
}
[/file]
the outcoming is very ugly aligned, since the whole [genTypes/] part is
too much indented.
2. How to use the seperator(',') construct correctly in a for-loop.
Currentlty, the , will be inserted in the next line, not after the
generated line
boolean confirmationExpected
, integer data optional
The loop looks like
[for (p:Property | c.oclAsType(Classifier).attribute) separator(',')]
[if (p.type.oclIsTypeOf(PrimitiveType))][iterateBasicType(p)/]
[else]
Complex
[/if]
[/for]
3. Is it possible to pass a Set as a template parameter?
4. I've tried to pass a parameter like c.oclAsKindOf(Class), where c is
a Classifier, but Acceleo told me, that such an template doesn't exist.
Well, the template is there.
[template public class2type(c:Class)]
Is it possible to downcast an object during the invocation of a template?
Thanks a lot
/Timothy
|
|
|
Re: [Acceleo] Code Beautifying [message #484554 is a reply to message #484528] |
Tue, 08 September 2009 08:29 |
|
This is a multi-part message in MIME format.
--------------020205090400080304000605
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi Timothy,
Comments inlined below.
Timothy Marc a
|
|
|
Powered by
FUDForum. Page generated in 0.02591 seconds