Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Constraint support ?
[Acceleo] Constraint support ? [message #638840] Fri, 12 November 2010 13:00 Go to next message
Eclipse UserFriend
Hi,

I need to use Acceleo to translate OCL expressions into a target language.
Is that supported? It must be "yes!" but after hours spent searching, I have not found any answer.
Is there a documentation (or better, examples) that can help?

To further illustrate this need, you can look at this page (thank's Jordi for posting this survey)... Acceleo could appear there as well, right ?

Cheers,
Stephane.
Re: [Acceleo] Constraint support ? [message #638859 is a reply to message #638840] Fri, 12 November 2010 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Stephane,

Well, you can create a module with templates based on the OCL metamodel and then generate something from it. A bit like this:
http://img703.imageshack.us/img703/9805/ocl.png

I'm pretty sure it would involve very complex templates because OCL is quite large but technically I'm sure it can be done.

And given the fact that the metamodel of the Acceleo language uses the OCL metamodel (a template is a kind of OCL expression), you could apply your templates to transform an Acceleo module in something else with it. Very Happy

Stéphane Bégaudeau, Obeo

[Updated on: Fri, 12 November 2010 14:21] by Moderator

Re: [Acceleo] Constraint support ? [message #638875 is a reply to message #638840] Fri, 12 November 2010 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Ok, thanks for the code snippet.

At least that sounds feasible...

I guess that some parsing will be required to get an OCLExpression as it does not seem to be stored as such... the discussion here certainly still applies (I haven't checked though).

Do you know of any other work in this area that could help?

It sounds like this could be a candidate feature for the future out-of-the-box modules delivered with Acceleo (btw I haven't seen those delivered with Acceleo 3 but I recall there were a number of them provided for the previous versions: Java, Php, Python, Dolibarr, C...).

I'm unsure I will start this from scratch and I'm confident this will be addressed in the future, esp. now OCL is more used in Acceleo and given that some competing tools already have the feature.

Stephane.

Re: [Acceleo] Constraint support ? [message #638910 is a reply to message #638840] Sat, 13 November 2010 01:00 Go to previous message
Eclipse UserFriend
Hi Stephane

This is largely an OCL question.

A flexible OCL to Java or ... code generator is planned for MDT/OCL; not
sure when.

Acceleo may be appropriate for the final M2T stage, but significant M2M
preparation is needed first. In particular, type analysis must plan how
OCL's unlimited, null, invalid type values are mapped to an
implementation type system. This requires determination of the extreme
values of each value and whether each value can be null or invalid.

Regards

Ed Willink




On 12/11/2010 18:00, sabst@free.fr wrote:
> Hi,
>
> I need to use Acceleo to translate OCL expressions into a target
> language.
> Is that supported? It must be "yes!" but after hours spent searching,
> I have not found any answer.
> Is there a documentation (or better, examples) that can help?
>
> To further illustrate this need, you can look at
> http://www.jordicabot.com/research/OCLSurvey/index.html (thank's Jordi
> for posting this survey)... Acceleo could appear there as well, right ?
> Cheers,
> Stephane.
Previous Topic:[xpand] how to list elements of a containment reference (Ecore model)
Next Topic:[Xpand] Newline style of output files
Goto Forum:
  


Current Time: Fri Jul 04 10:40:12 EDT 2025

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

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

Back to the top