Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » mix different extensions with different content in one project(mix different extensions with different content in one project)
mix different extensions with different content in one project [message #727434] Wed, 21 September 2011 09:49 Go to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hello,
I have created one grammar, which consist of 3 more-less independent parts. It works perfect, but I need to do following improvement:
I would like to have in projects different extension for all of these 3 parts. These would not be big problem itself... I would just create 3 separate projects and use generated plugins from all of them. Problem is, that I need to reference between these files, as it is contained in one grammar.
How can I do this? Is there any manual for doing this?

Example:
Now I have all my content in file1.xyz, file2.xyz (in all files are allowed same EntityTypes and can be mixed)...
SomeEntityType EntityA{
   var a
   var b
}

AnotherEntityType EntityB{
   varref x EntityA.A
   entityref = EntityC
}

OneMoreEntityType EntityC{
   varrefref EntityB.x
   varref EntityA.b
}


And I want now to SomeEntityType is only in files with extension .xyzA, AnotherEntityType in .xyzB and OneMoreEntityType in .xyzC in one Eclipse project and they should allow same referencing as before.

NOTE: SomeEntityType does not need to reference anything, AnotherEntityType needs to reference both SomeEntityType and OneMoreEntityType and OneMoreEntityType needs to reference both SomeEntityType and AnotherEntityType according to example above.

Thank you in advance.
Regards,
Michal
Re: mix different extensions with different content in one project [message #727699 is a reply to message #727434] Wed, 21 September 2011 20:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

what about using 3 dsls with one common manually maintained metamodel?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: mix different extensions with different content in one project [message #727700 is a reply to message #727699] Wed, 21 September 2011 20:51 Go to previous messageGo to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hi Christian,
thank you for answer. Could you give me some hints, how to create common manually maintaned metamodel?
Best Regards,
Michal
Re: mix different extensions with different content in one project [message #727703 is a reply to message #727700] Wed, 21 September 2011 20:52 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you create a normal ecore (empty emf) project with an ecore + genmodel, generate the model code,
and then reference to this existing ecore from xtext.
maybe you can initially copy the ecore from your dsl.

~Christian


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

[Updated on: Wed, 21 September 2011 20:53]

Report message to a moderator

Previous Topic:Multiple generated ecore files
Next Topic:Declaring predicates
Goto Forum:
  


Current Time: Fri Apr 26 14:06:18 GMT 2024

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

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

Back to the top