Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:38 Go to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

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 16:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 07 August 2012 16:51]

Report message to a 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] Thu, 09 August 2012 00:00 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

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] Thu, 09 August 2012 03:03 Go to previous message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

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 Apr 24 22:43:50 GMT 2024

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

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

Back to the top