[Xtext 2.11] Xcore [message #1756322] |
Wed, 15 March 2017 11:29 |
Marc Schlegel Messages: 69 Registered: July 2009 |
Member |
|
|
Hello everyone
I've setup a Xtext project with an imported Ecore model. After experimenting with Xcore I've decided that I can edit my Ecore model much quicker using Xcore so I would like to tell my MWE to load my Xcore definition rather than the manually generated Ecore/Genmodel-files.
There is a Blog from Lorenzo Bettini which switches to Xcore but unfortunately his Blog uses the old MWE setup (pre Xtext 2.9).
Right this, this is what I have
Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerEcoreFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
registerEcoreFile = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore"
registerGenModelFile = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
// switch to xcore
// loadedResource = "platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore"
// loadedResource = "platform:/resource/${projectName}/model/Helloxcore.xcore"
// remove when xcore
registerGenModelFile = "platform:/resource/${runtimeProject}/model/edos.genmodel"
registerEcoreFile = "platform:/resource/${runtimeProject}/model/edos.ecore"
}
...standard stuff...
loadedResource is not available anymore in the StandaloneSetup, so I've tried using the referencedResource within StandardLanguage
language = StandardLanguage {
name = "removedForForum"
fileExtensions = "${file.extension}"
referencedResource = "platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore"
referencedResource = "platform:/resource/${runtimeProject}/model/edos.xcore"
This doesnt work with
Caused by: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore; systemId: platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1437)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
So the question is: how can I register the Xcore-artifacts and my Xcore-definition with the new MWE configuration for Xtext 2.11?
[Updated on: Wed, 15 March 2017 11:31] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05903 seconds