Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMFTVM Documentation Issues
EMFTVM Documentation Issues [message #1717179] Thu, 10 December 2015 13:48 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
Hi,
I found a two differences between the regular VM and EMFTVM in version 3.6.0 that seem not to be documented:
- String.replaceAll() in the EMFTVM is the same as String.regexpReplaceAll()
- A lazy rule with an imperative section (do {...}) returns OclUndefined. To return the created element it must be added as the return value of the section.
Did I miss some piece of documentation?
Are there more potential gotchas?
Thanks!

Re: EMFTVM Documentation Issues [message #1717338 is a reply to message #1717179] Fri, 11 December 2015 21:40 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

String.replaceAll() in EMFTVM maps to the Java String.replaceAll(). EMFTVM transparently maps each Java method that is not explicitly defined in the VM's built-in library. I had added regexReplaceAll() as a built-in function, but I had not remapped replaceAll() to Java's String.replace(). Java methods that are transparently mapped are translated to native method invocations by EMFTVM's JIT compiler, so they are more efficient. You can use String.replace() in EMFTVM to get the behaviour of regular ATL's String.replaceAll(). I will document this difference on the EMFTVM wiki page.

EMFTVM lazy rules return their default output element when they have no "do" block. When there is a "do" block, you must indeed specify the returned element manually. I was under the impression that this behaviour was the same as in regular ATL. If this is not the case, please file a bug against EMFTVM.

Another "gotcha" is that EMFTVM is more strict about reading from the output model (forbidden in regular ATL too, but not always checked). Also, EMFTVM uses its own immutable collections framework, so you cannot do this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=405587. There may be more "gotchas" that I haven't thought of or am not yet aware of. Feel free to report them as you discover them! I will fix them where appropriate, or at least document them.


Cheers,
Dennis
Previous Topic:XML schema as source file
Next Topic:Checking whether ATL module may be used for given target MM and model
Goto Forum:
  


Current Time: Fri Apr 19 10:18:33 GMT 2024

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

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

Back to the top