|
Re: [Acceleo] Fix me! [message #537495 is a reply to message #537474] |
Wed, 02 June 2010 15:40 |
|
This is a multi-part message in MIME format.
--------------080707090804020200010801
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Daniel,
See comments inlined below.
Laurent Goubet
Obeo
Daniel wrote:
> Hi, I wanted to know if you know I way to fix some problems I get when
> using the mt2mtl feature. I got a message telling me it has no
> equivalent on functions like: get, put and split this are the cases:
>
> 1.
> From:
> <%script type="uml.Model" name="validator" file="<%validationOutput%>"%>
> <%get("validationResult")%>
>
> To:
> [file (validationOutput(), false))]
> [<<<FIXME "get()" has no equivalent in Acceleo OCL.
> get('validationResult')>>>/]
> [/file]
>
> 2.
> From:
> <%script type="uml.Model" name="validationOutput" post="trim" %>
> <%doValidate.put("validationResult")%><%validationFilePath% >
>
> To:
> [template public validationOutput(model : uml::Model) post(trim())]
> [doValidate().<<<FIXME "put(String, Object)" has no equivalent in
> Acceleo OCL. put('validationResult',
> 'validationResult')>>>/][validationFilePath()/]
> [/template]
I'll answer here for both 1. and 2. There is no equivalent of the four
"variable stack" services of Acceleo 2 : push(), pop(), put() and get().
In Acceleo 3 the variables are explicit, and the generation should then
be rethought in order to use explicit variables.
That would mean passing the result of "doValidate()" explicitely to the
template using "get('validationResult')" from the template that does
"put('validationResult', doValidate())".
Granted, this is easier said than done with UML2Java or other "big"
modules ... but that should greatly clarify these modules and ease their
maintenance.
>
> 3.
> From:
> <%script type="Element" name="getOrderedCollectionClass" post="trim" %>
> <%getOrderedCollectionClassPath.split("\.").nLast()%>
>
> To:
> [template public getOrderedCollectionClass(element : Element) post(trim())]
> [getOrderedCollectionClassPath().<<<FIXME "split" has no equivalent in
> Acceleo OCL. split('\.')>>>->last()/]
> [/template]
"Split" hasn't been implemented in Acceleo 3, you could use
"tokenize('.')" instead for this use case.
--------------080707090804020200010801
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------080707090804020200010801--
|
|
|
|
Powered by
FUDForum. Page generated in 0.03661 seconds