Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Two DSL in same project(DSL "B" read entities defined in DSL "A".)
Two DSL in same project [message #1775937] Wed, 08 November 2017 12:21 Go to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Hi, I have a DSL "A" with entities and some others functionalities to generate Java services backend contracts. Now I would like to create a new DSL "B" in the same project (in the same Eclipse plug-in for the existing DSL "A"), in order to read these entities defined in DSL "A" to generate JPA code for these entities and others artifacts. It this possible? What are the steps to do this?

Thank you very much in advance.
Re: Two DSL in same project [message #1775938 is a reply to message #1775937] Wed, 08 November 2017 12:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12105
Registered: July 2009
Senior Member
simply having two language sections in the workflow should do the trick

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Two DSL in same project [message #1776428 is a reply to message #1775938] Thu, 16 November 2017 11:55 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Hi, Thanks for your answered.
I decided to create a new xText project for the new DSL "B", called "EDL", that must reference elements in existing DSL "A". I followed your Blog's post "Xtext: Referencing Elements of one DSL from another DSL". But I getting an error when I run GenerateEDL.mwe2 (the error happens only if I reference the DSL "A"). Can you give me some help? I already searched on Google without success.
In the Error.zip file I put the main files to inspect the problem.

Thank you very much for the help.
  • Attachment: Error.zip
    (Size: 117.12KB, Downloaded 33 times)
Re: Two DSL in same project [message #1776430 is a reply to message #1776428] Thu, 16 November 2017 12:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5970
Registered: July 2009
Senior Member
Hi

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@326f3ab4 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2264ea32 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/br.com.senior.edl/model/generated/EDL.genmodel, 10, 129)

strongly suggests a problem with the br.com.senior.edl registration

3230 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'br.com.senior.sdl.model' from 'file:///C:/mk/git/sdl/br.com.senior.sdl.model/model/sdl.xcore'

is inconsistent. "file:///" is unusual. I would need to read the specification to see what it really means. But I suspect it is at least one of your problems.

Regards

Ed Willink
Re: Two DSL in same project [message #1776432 is a reply to message #1776430] Thu, 16 November 2017 12:24 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Yes, I agree with you, I think the correct way is to use:
referencedResource = "platform:/resource/br.com.senior.sdl.model/model/sdl.xcore"

but then I get the error: java.lang.RuntimeException: Problems running workflow br.com.senior.edl.GenerateEDL: java.io.IOException: The path '/br.com.senior.sdl.model/model/sdl.xcore' is unmapped
It only works if I install the DSL plug-in "A" in my Eclipse.
Re: Two DSL in same project [message #1776436 is a reply to message #1776432] Thu, 16 November 2017 12:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12105
Registered: July 2009
Senior Member
can you share a complete example project zoo? see https://github.com/cdietrich/xtext-ecore-xcore

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Two DSL in same project [message #1776455 is a reply to message #1776436] Thu, 16 November 2017 14:47 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
The two projects are attached.

[Updated on: Fri, 17 November 2017 15:28]

Report message to a moderator

Re: Two DSL in same project [message #1776463 is a reply to message #1776455] Thu, 16 November 2017 15:40 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12105
Registered: July 2009
Senior Member
am only geting [INFO] {osgi.os=macosx, osgi.ws=cocoa, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: br.com.senior.edl 1.0.0.qualifier
[ERROR] Missing requirement: br.com.senior.sdl.language 17.2.2.201711161536 requires 'bundle org.apache.commons.lang3 0.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: br.com.senior.edl 1.0.0.qualifier depends on: bundle br.com.senior.sdl.language 17.2.2
thats not related to your initial problem

for your second problem i have no idea. would be a question for the EMF forum


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Loading file-based ecore files from xText DSML
Next Topic:(Xbase)Method refers to missing type .. : List Values cannot get passed as parameter or return value
Goto Forum:
  


Current Time: Tue Jul 17 23:00:03 GMT 2018

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

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

Back to the top