Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Use xmi elements inside the dsl
Use xmi elements inside the dsl [message #1000691] Tue, 15 January 2013 09:12 Go to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Hello everyone!

I've got a complex situation in my hands. I've got an ecore project where I can define some "Functions". From this ecore I've generated an .xmi file with a sample function definition.

My DSL uses that ecore:
...
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceEdit.ecore" as coreSequence
...
RealFunction:
	'REAL_FUNCTION'
	function=[coreSequence :: Function]
;


What I want is this: user can call sample function (xmi file) from RealFunction rule.
Is the cross reference correct? How can I import the xmi file (need to have scope for defined functions)?

Thanks for your tips!
Re: Use xmi elements inside the dsl [message #1000700 is a reply to message #1000691] Tue, 15 January 2013 09:35 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

I can't edit last message, so here are the update:

I think I can resolve that cross reference with a global scope, but I can't find an useful example of it.
Re: Use xmi elements inside the dsl [message #1000757 is a reply to message #1000700] Tue, 15 January 2013 11:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

am not quite sure what you want to do. xmi is a very generic term.
do you mine you have a test.mystuff file which is an xmi persited ecore based model and you want to reference it?
something like http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Use xmi elements inside the dsl [message #1000783 is a reply to message #1000757] Tue, 15 January 2013 12:37 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Exactly
Re: Use xmi elements inside the dsl [message #1000785 is a reply to message #1000783] Tue, 15 January 2013 12:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
so the solution is in the blog

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Use xmi elements inside the dsl [message #1000820 is a reply to message #1000691] Tue, 15 January 2013 13:24 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

But I need to menage import of xmi files,

user could write some imports and use objects inside those.
Re: Use xmi elements inside the dsl [message #1000833 is a reply to message #1000820] Tue, 15 January 2013 13:52 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
What about a complete real world example!

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Line break after multi-line comments using serialization
Next Topic:What is best way to get reference of JvmAnnotationType in inference?
Goto Forum:
  


Current Time: Thu Apr 25 12:37:41 GMT 2024

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

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

Back to the top