Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Code Beautifying
[Acceleo] Code Beautifying [message #484528] Tue, 08 September 2009 06:57 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member

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 ('.ttcn3'), false)]
module []{
[for (dPool : DataPool | testContext.allDataPool)]
[for (dp:DataPartition|dPool.ownedPartition)]

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)/]

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

Re: [Acceleo] Code Beautifying [message #484554 is a reply to message #484528] Tue, 08 September 2009 08:29 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Timothy,

Comments inlined below.

Timothy Marc a
Previous Topic:xtext for metamodeling
Next Topic:Check: How to activate the EMF Validation Adapter?
Goto Forum:

Current Time: Fri Mar 05 08:23:12 GMT 2021

Powered by FUDForum. Page generated in 0.02122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top