Xcore -> Xtext [message #1082529] |
Thu, 08 August 2013 13:58  |
Eclipse User |
|
|
|
Just read Jan's excellent: http://koehnlein.blogspot.ca/2013/06/using-xcore-in-xtext.html at his suggestion.
Currently I'm using the xcore -> genmodel -> xtext approach for referring to the imported gen model, but I can't get the score version working quite yet..
I have EMF Metamodels (only) activated. In the mwe I'm currently importing registering the package like:
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGeneratedEPackage = "my.MyPackage"
registerGenModelFile = "platform:/resource/my/model/My.genmodel"
}
I tried adding a line to the (xtext project wizard created) generator component thus:
language = auto-inject {
uri = grammarURI
... many lines later
loadedResource = "platform:/resource/my/model/My.xcore"
}
Then at Jan's suggestion I removed the registerGenModelFile line and when that didn't work the registerGeneratedEPackage as well.
I'm importing the source xcore/ecore like this :
Could you post an example workflow for setting this up?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Xcore -> Xtext [message #1083549 is a reply to message #1083342] |
Sat, 10 August 2013 00:41  |
Eclipse User |
|
|
|
Miles,
Note that https://bugs.eclipse.org/bugs/show_bug.cgi?id=412429 is open
to consider this issue. I investigated it and while the Xcore stand
alone setup correctly configures the standalone resource set to support
this implicitly, that's not the resource set into which the grammar is
loaded, and hence the problem.
On 09/08/2013 10:52 PM, Miles Parker wrote:
> Thanks Christian, that did it! :d
>
> Here's where I went wrong:
>
> As mentioned above, I had something like
>
> Quote:
>> language = auto-inject {
>> uri = grammarURI loadedResource =
>> "platform:/resource/my.package/model/my.xcore"
>
>
> This is what I needed:
>
> Quote:
>> language = auto-inject {
>> loadedResource =
>> "platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore"
>> loadedResource = "platform:/resource/my.package/model/my.xcore"
>> uri = grammarURI
>
>
> Two things are different:
>
> 1. I needed to load the XCoreLanguage explicitly, I guess it doesn't
> import transitively.
> 2. Putting the uri = grammar line first doesn't work. I'm not sure why
> that is, presumably there is some side-effect of that assignment..
>
|
|
|
Powered by
FUDForum. Page generated in 0.52700 seconds