Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] Copying content from one Xcore model to another programmatically([Xcore] Copying content from one Xcore model to another programmatically)
[Xcore] Copying content from one Xcore model to another programmatically [message #1336042] Tue, 06 May 2014 07:52 Go to next message
Sabine Mising name is currently offline Sabine Mising nameFriend
Messages: 1
Registered: May 2014
Junior Member
Hello everybody,

I am copying parts of one Xcore-file into another programmatically.
While copying Xcore works well, xbase implemented operations seem to cause some problems. Some "words" are changed during the copy-process:

var x = AProjectsFactory.eINSTANCE.create(...)
x.EReferences() //as required by my Xcore-Version with a capital letter...

becomes

var x = super.eINSTANCE}.create(...)
x.eReferences() // ...and a nice error marker

Seems like Xcore is keeping track of what xbase-references?!?
Has anybody an idea how to avoid this? Or can tell me what am I doing wrong?

Second thing I observed is: Xbase references to the Ecore MM must start with
a capital letter (x.EReferences(),x.EOperations() ) - so: why? Any other reference works fine with non capital letter...
I would like to have a consistent concrete Syntax - so am I doing something wrong? And what?

(I am using Xcore Version 1.1.1.v20130903-0948)

Thanks in advance!
Sabine
Re: [Xcore] Copying content from one Xcore model to another programmatically [message #1336842 is a reply to message #1336042] Tue, 06 May 2014 15:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Sabine,

Comments below.

On 06/05/2014 3:45 PM, Sabine Mising name wrote:
> Hello everybody,
>
> I am copying parts of one Xcore-file into another programmatically.
Hmmm. Via the node model? Unless you do it textually, it's likely to
lose information, like formatting (and the formatter is quite bad)
> While copying Xcore works well, xbase implemented operations seem to
> cause some problems. Some "words" are changed during the copy-process:
> var x = AProjectsFactory.eINSTANCE.create(...)
> x.EReferences() //as required by my Xcore-Version with a capital
> letter...
>
> becomes
>
> var x = super.eINSTANCE}.create(...)
That seems quite wrong... Where was this code located?
> x.eReferences() // ...and a nice error marker
>
> Seems like Xcore is keeping track of what xbase-references?!?
The bodies are Xbase expressions, so yes, we depend on Xbase also doing
the right thing.
> Has anybody an idea how to avoid this? Or can tell me what am I doing
> wrong?
>
> Second thing I observed is: Xbase references to the Ecore MM must
> start with a capital letter (x.EReferences(),x.EOperations() ) - so: why?
They purely follow the Bean specification; it's a little annoying.
> Any other reference works fine with non capital letter...
It's more of an Xbase question, best asked on the TMF forum.
> I would like to have a consistent concrete Syntax - so am I doing
> something wrong? And what?
>
> (I am using Xcore Version 1.1.1.v20130903-0948)
I'm not sure the approach you've taken is a good one. I think for a
textual language one should focus on transferring the full text,
comments and all...
>
> Thanks in advance!
> Sabine


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Serialize multivalued EReference
Next Topic:[Texo] create code depending on a user defined annotation
Goto Forum:
  


Current Time: Fri Apr 26 07:01:17 GMT 2024

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

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

Back to the top