EMFTVM Documentation Issues [message #1717179] |
Thu, 10 December 2015 08:48  |
Eclipse User |
|
|
|
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 16:40  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.05169 seconds