Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Content-Assist for imported libraries
Content-Assist for imported libraries [message #1660689] Mon, 09 March 2015 09:43 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi all,

I've just read that content-assist should work for imported libraries.

Like it is told here: http://www.eclipse.org/forums/index.php/t/205043/

But unfortunately I am not able to enable the content-assist like it is mentioned in the
upper post.
Does the ATL-Plugin changed, or is this feature disabled in the current version of ATL?

~Alex
Re: Content-Assist for imported libraries [message #1670691 is a reply to message #1660689] Fri, 13 March 2015 09:47 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 357
Registered: September 2012
Location: Belgium
Senior Member

No, it still works for me (thanks for the heads-up: didn't even know about this feature). You can try the following:


  1. Make sure you specify a workspace path, i.e. "/project/folder/file.atl"
  2. Make sure you also specify the referenced ATL library/module in the "uses" clause



Cheers,
Dennis
Re: Content-Assist for imported libraries [message #1670957 is a reply to message #1670691] Fri, 13 March 2015 12:02 Go to previous messageGo to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I've got it running.

But do you know if it is possible to define a atl-library for a use in a 'more-common' way? I mean something like a "sequenceLibrary", which I may use from different atl-modules.

According to the ATL-Documentation helpers have to have a context. But a 'collection-context' is not supported yet.

So how do my library has to look like if I want this rule to be accessable from other modules (which of course imports the sequenceLibrary)?:

helper def: invertList(list: Sequence(OclAny)): Sequence(OclAny) =
	list -> iterate(el; invertedList: Sequence(OclAny) = Sequence{} | invertedList.prepend(el));



Do you have any ideas how to achieve this?

Regards and many thanks

Alex
Re: Content-Assist for imported libraries [message #1676167 is a reply to message #1670957] Sun, 15 March 2015 10:59 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 357
Registered: September 2012
Location: Belgium
Senior Member

The helper you gave as an example is a valid helper, and has an implicit context: "thisModule". You can define any helpers in a library, even the ones that refer to types from metamodels (i.e. metaclasses).

I can imagine you'll want to define new collection operations as helpers with a collection type context, which is not possible in regular ATL. Support for this is added in ATL/EMFTVM. I have added it to the corresponding wiki page. The specific "invertList" operation you mentioned already exists in OCL 2.2 as the "reverse" operation, and is therefore part of ATL/EMFTVM as well.

Finally, experimental support for adding you own higher-order collection operations (called "iterators" in OCL) can be found in SimpleOCL, which compiles to ATL/EMFTVM bytecode and can be used from ATL. See iterators.simpleocl for an example of what you can do.


Cheers,
Dennis

[Updated on: Sun, 15 March 2015 15:08]

Report message to a moderator

Previous Topic:Hover information shows wrong parametersorder
Next Topic:M2T transformation
Goto Forum:
  


Current Time: Mon Apr 23 04:13:34 GMT 2018

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

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