Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] proper signature of template
[Acceleo] proper signature of template [message #1804893] Tue, 02 April 2019 20:27 Go to next message
Tomasz  abczy?ski is currently offline Tomasz abczy?skiFriend
Messages: 11
Registered: May 2015
Junior Member
Hi,
tell me, please what exactly means the following template call:
[xx('txt')/]
assuming that self is of type String.

  1. xx(a1: String, a2: String) where a1=self (of the caller), a2='txt',
  2. xx(a1: String) where a1='txt',
  3. first of the above which is defined
  4. nothing of the above, I completely misunderstand it?

The experiments show that the third option is true.
I'm confused because when none is defined, the OCL in Acceleo parser generate only one error mark with the signature (1) so only this version can be generated as quick fix. The mark is not (and it shouldn't be) generated if the second variant is defined as it would be more general case.

Tom


Tomasz Babczyński
Re: [Acceleo] proper signature of template [message #1804899 is a reply to message #1804893] Wed, 03 April 2019 05:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

My recollection (sorry cannot find the Bugzilla) is that it is indeed confusing; the OMG MOFM2T specification is inadequate. Acceleo, as the only implementation of MOFM2T, had to pioneer a solution which should have been reflected in a MOFM2T 1.1. As such you may find some clues in more recent Acceleo documentation.

The principle is that a new helper X::Y(...) may be declared for use by templates as anX.Y(...) without needing to change the metamodel for X. Use of the new helper effectively requires arguments to be shifted along once.

Complexities arise from polymorphic overload and use of non-EObject datatypes that are not traceable.

If you want to use these facilities you are probably better off figuring it out yourself rather than relying on my recollection.

Regards

Ed Willink
Re: [Acceleo] proper signature of template [message #1804906 is a reply to message #1804899] Wed, 03 April 2019 07:08 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Ed Willink wrote on Wed, 03 April 2019 01:14
My recollection (sorry cannot find the Bugzilla


It was https://www.eclipse.org/forums/index.php?t=msg&th=208238&goto=784647&#msg_784647

The Acceleo team chose to stick to the letter of the MOFM2T specification rather than pioneer a more OOP approach that might be more in keeping with the spirit of MOFM2T.

https://wiki.eclipse.org/Acceleo/FAQ#How_does_the_overriding_system_works_in_Acceleo_.3F provides better documentation.

Regards

Ed Willink
Previous Topic:Does the Acceleo model-to-text transformation support different kind of input models in .mtl file?
Next Topic:[xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x?
Goto Forum:
  


Current Time: Thu Apr 25 20:13:55 GMT 2024

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

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

Back to the top