[XText] how import package in an ecore metamodel using platform url? [message #46415] |
Fri, 29 May 2009 14:21 |
Mikai Yang Messages: 149 Registered: July 2009 |
Senior Member |
|
|
Hi,
I created an XText project, called ALxDSL, using the XText wizard. My dsl is named 'alx'. The XText grammar file of this dsl is located in the
package src.hw., and in the same directory is my ecore metamodel of this dsl, called alxmm.ecore. In the grammar file, I import this metamodel using
the folling line:
import "platform:/resource/ALxDSL/src/hw/alxmm.ecore"
It is imported succesfully. I would also like to import all sub-packages of this metamodel. For example, the top package of this metamodel is
'alxmm'; the sub-packages are 'declaration','statement', 'expression'.
Would you please give me some hints about importing these subpackages using platform url?
Regards.
Michael.
|
|
|
Re: [XText] how import package in an ecore metamodel using platform url? [message #46509 is a reply to message #46415] |
Fri, 29 May 2009 20:45 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
You have to import each epackage using its URI.
It depends on the structure of your ecore model how the URIs look like.
If alxmm is the only root package and the other three are direct
subpackages the uris look like so:
import "platform:/resource/ALxDSL/src/hw/alxmm.ecore#/"
import "platform:/resource/ALxDSL/src/hw/alxmm.ecore#//declaration"
import "platform:/resource/ALxDSL/src/hw/alxmm.ecore#//statement"
import "platform:/resource/ALxDSL/src/hw/alxmm.ecore#//expression"
Cheers,
Sven
Michael schrieb:
> Hi,
> I created an XText project, called ALxDSL, using the XText wizard.
> My dsl is named 'alx'. The XText grammar file of this dsl is located in
> the package src.hw., and in the same directory is my ecore metamodel of
> this dsl, called alxmm.ecore. In the grammar file, I import this
> metamodel using the folling line:
>
> import "platform:/resource/ALxDSL/src/hw/alxmm.ecore"
>
> It is imported succesfully. I would also like to import all
> sub-packages of this metamodel. For example, the top package of this
> metamodel is 'alxmm'; the sub-packages are 'declaration','statement',
> 'expression'.
>
> Would you please give me some hints about importing these subpackages
> using platform url?
>
>
> Regards.
>
> Michael.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03688 seconds