Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How to create a new DSL that can reference objects defined in a different dsl(Trying to figure out how to have a .people file with persons defined that can be imported and then have people objects references in that file in another dsl like .groups)
How to create a new DSL that can reference objects defined in a different dsl [message #900576] Tue, 07 August 2012 11:38 Go to next message
Eclipse UserFriend
I am confused on how to set up two different dsl languages I have created with xtext so that in my eclipse workspace my second dsl can import files of the first dsl type and reference objects in that file. Here is an example:

I have a .people DSL that defines Person Objects, in my project for example I have friends.people and then I have another DSL that defines groups of people. In this DSL I want to be able to create a Group entity that can reference existing person objects in existing .people files in the workspace a lot like a ecore model referencing another ecore. Does anyone know if there are examples for this?

Would I have to import the .people grammer in my .groups grammer and then how do I go about setting up my .groups editor to say something like import /friends.people and then once imported in my editor when I create a group I can see the people as drop down options defined in the friends.people file I imported.

I looked around and can't seemn to find a good example on this, any help would be appreciated as I'm trying to figure out how to decouple my xtext models into seperate DSL's.

Another real world example is what I'm actually working on which is a file that defines stock signals and indicators and in my second dsl I want to reference those signals defined in other files as part of my trading strategies.

Thanks for any help. - Duncan

Re: How to create a new DSL that can reference objects defined in a different dsl [message #900597 is a reply to message #900576] Tue, 07 August 2012 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

since you are not the first guy asking: your personal blog post
http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/

~Christian

[Updated on: Tue, 07 August 2012 12:51] by Moderator

Re: How to create a new DSL that can reference objects defined in a different dsl [message #900910 is a reply to message #900597] Wed, 08 August 2012 20:00 Go to previous messageGo to next message
Eclipse UserFriend
Many thanks, look forward to going through it tonight! - Duncan
Re: How to create a new DSL that can reference objects defined in a different dsl [message #900914 is a reply to message #900576] Wed, 08 August 2012 23:03 Go to previous message
Eclipse UserFriend
I followed your blog, was very useful and posted a question on that site. Thanks again for the help. - Duncan
Previous Topic:How to reference images setup by IEObjectLabelProvider inside MyDslEObjectHoverProvider ?
Next Topic:issue at opening files or at startup of eclipse
Goto Forum:
  


Current Time: Wed Jul 16 21:51:44 EDT 2025

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

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

Back to the top