Using XCore Model for XText DSL [message #1061758] |
Mon, 03 June 2013 15:26  |
Eclipse User |
|
|
|
Hi,
I'm currently trying to use an XCore model as the base model for my XText DSL without having to generate an genmodel/ecore file for it.
My project setup looks like the following:
model-project/model/foo.xcore (containing one model class Foo { String name })
test.dsl
test.dsl.sdk
test.dsl.tests
test.dsl.ui
The model project exports all generated packages and the 'model' folder, the XText main project has a bundle dependency for it. In the MWE2 Workflow I define the inclusion of the XCore Model as follows:
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGeneratedEPackage = "foo.FooPackage"
registerGenModelFile = "platform:/resource/model-project/model/foo.xcore"
}
(I tried to registerEcoreFile & registerGenModelFile before which also didn't work and then went with the workaround proposed here https://bugs.eclipse.org/bugs/show_bug.cgi?id=379994)
In the .xtext file everything works out as expected, after adding the import I can define a rule to catch the one model class.
When I want to generate the DSL Infrastructure through the MWE2 file, I get the following exception:
Caused by: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/model-project/model/foo.xcore; systemId: platform:/resource/model-project/model/foo.xcore; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog.
I tested this both with Juno SR2 and Kepler RC2 and it gave the same exception both times. Is that use case currently not possible or am I still doing something wrong?
Regards,
Johannes
|
|
|
Re: Using XCore Model for XText DSL [message #1061823 is a reply to message #1061758] |
Tue, 04 June 2013 05:07  |
Eclipse User |
|
|
|
The following resolved bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=379999
has a working example attached. Instead of loading the xcore file in the
standalone setup, you have to do this in the language section of the
Generator:
loadedResource =
"platform:/resource/${projectName}/src/org/xtext/example/mydsl/MyDsl.xcore"
Also make sure you are running a current RC of MWE2, Xtext and Xcore.
Am 03.06.13 23:03, schrieb Johannes Wachter:
> Hi,
>
> I'm currently trying to use an XCore model as the base model for my
> XText DSL without having to generate an genmodel/ecore file for it.
>
> My project setup looks like the following:
>
>
> model-project/model/foo.xcore (containing one model class Foo { String
> name })
> test.dsl
> test.dsl.sdk
> test.dsl.tests
> test.dsl.ui
>
>
> The model project exports all generated packages and the 'model' folder,
> the XText main project has a bundle dependency for it. In the MWE2
> Workflow I define the inclusion of the XCore Model as follows:
>
>
> bean = StandaloneSetup {
> scanClassPath = true
> platformUri = "${runtimeProject}/.."
> registerGeneratedEPackage = "foo.FooPackage"
> registerGenModelFile =
> "platform:/resource/model-project/model/foo.xcore"
>
> }
>
>
> (I tried to registerEcoreFile & registerGenModelFile before which also
> didn't work and then went with the workaround proposed here
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=379994)
>
> In the .xtext file everything works out as expected, after adding the
> import I can define a rule to catch the one model class.
>
> When I want to generate the DSL Infrastructure through the MWE2 file, I
> get the following exception:
>
>
> Caused by: org.xml.sax.SAXParseExceptionpublicId:
> platform:/resource/model-project/model/foo.xcore; systemId:
> platform:/resource/model-project/model/foo.xcore; lineNumber: 1;
> columnNumber: 1; Content ist nicht zulässig in Prolog.
>
>
>
> I tested this both with Juno SR2 and Kepler RC2 and it gave the same
> exception both times. Is that use case currently not possible or am I
> still doing something wrong?
>
>
> Regards,
> Johannes
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.03514 seconds