Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Constraint support ?
[Acceleo] Constraint support ? [message #638840] Fri, 12 November 2010 18:00 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: November 2010
Junior Member
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 19:20 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

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 19:21]

Report message to a moderator

Re: [Acceleo] Constraint support ? [message #638875 is a reply to message #638840] Fri, 12 November 2010 20:51 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: November 2010
Junior Member
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 06:00 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7265
Registered: July 2009
Senior Member
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: Sun Sep 19 21:07:04 GMT 2021

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

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

Back to the top