Home » Modeling » M2T (model-to-text transformation) » [Xtext+Xpand] Problem with MWE code generator workflow
[Xtext+Xpand] Problem with MWE code generator workflow [message #497175] |
Thu, 12 November 2009 18:19 |
Steven Derrien Messages: 50 Registered: July 2009 |
Member |
|
|
Hello,
I am beating my head on some issue involving an Xtext DSL in which I
make references to EClass elements defined in some imported ecore files.
To do so I simply use the import mechanism as examplified below :
grammar test.dummyDsl with org.eclipse.xtext.common.Terminals
generate mydummyDsl "http://www.irisa.fr/dummyDsl"
import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
Toplevel :
(imports+=Import ';')*
('from' src+=[ecore::EClass] 'to' dst+= [ecore::EClass] ';')+
;
Import :
'import' importURI=STRING;
If I assume that ClassA and ClassB are Eclass objects defined in resp.
source.ecore ans des.ecore file, I could write a example like this.
import "platform:/resource/example/source.ecore";
import "platform:/resource/example/dest.ecore";
from A to B;
So far so good, the DSL and Editor work perflecly well, however, I can't
make the code generator work as expected. Whenever I run the MWE worflow
it complains that
2024 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/workspace/test.generator/bin/model/dummy.mydsl(5): Couldn't
resolve reference to EClass ClassA(Element: -UNKNOWN-; Reported by:
MweReader: loading file from classpath:/model/dummy.mydsl)
2024 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/workspace/test.generator/bin/model/dummy.mydsl(5): Couldn't
resolve reference to EClass ClassB(Element: -UNKNOWN-; Reported by:
MweReader: loading file from classpath:/model/dummy.mydsl)
....
I tried to look around for some solution to make MWEReader 'know' about
my two ecore files, by adding a <registerEcoreFile ..> tag, as shown below
<workflow>
<property name="modelFile" value="classpath:/model/dummy.mydsl"/>
<property name="targetDir" value="src-gen"/>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value=".."/>
<registerEcoreFile
value="/home/sderrien/workspace//example/source.ecore" />
<registerEcoreFile
value="/home/sderrien/workspace//example/dest.ecore" />
</bean>
...
</workflow>
But it didn't solve the issue, even though there is now a message in the
log stating that :
756 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding dynamic
EPackage 'http://dummy.source' from
'/home/sderrien/workspace//example/source.ecore'
756 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding dynamic
EPackage 'http://dummy.dst' from
'/home/sderrien/workspace//example/dest.ecore'
Any help would *really* be appreciated.
Thanks in advance,
Steven
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497223 is a reply to message #497175] |
Thu, 12 November 2009 22:05 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
did you try to use classpath uri for the imported source.ecore and
dest.ecore? These should be independent from the actual working directory.
Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Steven Derrien schrieb:
> Hello,
>
> I am beating my head on some issue involving an Xtext DSL in which I
> make references to EClass elements defined in some imported ecore files.
>
> To do so I simply use the import mechanism as examplified below :
>
> grammar test.dummyDsl with org.eclipse.xtext.common.Terminals
>
> generate mydummyDsl "http://www.irisa.fr/dummyDsl"
>
> import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
>
> Toplevel :
> (imports+=Import ';')*
> ('from' src+=[ecore::EClass] 'to' dst+= [ecore::EClass] ';')+
> ;
>
> Import :
> 'import' importURI=STRING;
>
>
> If I assume that ClassA and ClassB are Eclass objects defined in resp.
> source.ecore ans des.ecore file, I could write a example like this.
>
> import "platform:/resource/example/source.ecore";
> import "platform:/resource/example/dest.ecore";
>
> from A to B;
>
>
> So far so good, the DSL and Editor work perflecly well, however, I can't
> make the code generator work as expected. Whenever I run the MWE worflow
> it complains that
>
> 2024 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/workspace/test.generator/bin/model/dummy.mydsl(5): Couldn't
> resolve reference to EClass ClassA(Element: -UNKNOWN-; Reported by:
> MweReader: loading file from classpath:/model/dummy.mydsl)
>
> 2024 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/workspace/test.generator/bin/model/dummy.mydsl(5): Couldn't
> resolve reference to EClass ClassB(Element: -UNKNOWN-; Reported by:
> MweReader: loading file from classpath:/model/dummy.mydsl)
>
> ....
>
>
> I tried to look around for some solution to make MWEReader 'know' about
> my two ecore files, by adding a <registerEcoreFile ..> tag, as shown below
>
> <workflow>
> <property name="modelFile" value="classpath:/model/dummy.mydsl"/>
> <property name="targetDir" value="src-gen"/>
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <platformUri value=".."/>
> <registerEcoreFile
> value="/home/sderrien/workspace//example/source.ecore" />
> <registerEcoreFile
> value="/home/sderrien/workspace//example/dest.ecore" />
> </bean>
>
> ...
>
> </workflow>
>
>
> But it didn't solve the issue, even though there is now a message in the
> log stating that :
>
> 756 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding dynamic
> EPackage 'http://dummy.source' from
> '/home/sderrien/workspace//example/source.ecore'
> 756 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding dynamic
> EPackage 'http://dummy.dst' from
> '/home/sderrien/workspace//example/dest.ecore'
>
> Any help would *really* be appreciated.
>
> Thanks in advance,
>
> Steven
>
>
|
|
| |
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497246 is a reply to message #497245] |
Thu, 12 November 2009 22:49 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
I guess you are mixing things up. Why do you need to import the ecore
files in your grammar file _and_ in your workflow. If the import
mechanism works fine, there should be no need to import them in your
workflow explicitly.
The consequence might by, that you end up with to instances of the same
EPackage which may lead to different EClasses for the same name.
Did you try to omit the import in the workflow file?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Steven Derrien schrieb:
> Hi Sebastian,
>
> Thank for the quick reply,
>
> It seems that it is not a path issue since the log file indicate that
> the correponding Epackages are found during StandAloneSetup component
> execution :
>
> 756 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding dynamic
> EPackage 'http://dummy.source' from
> '/home/sderrien/workspace//example/source.ecore'
>
> Thanks,
>
> Steven
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> did you try to use classpath uri for the imported source.ecore and
>> dest.ecore? These should be independent from the actual working
>> directory.
>>
>> Hope that helps,
>> Sebastian
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497260 is a reply to message #497246] |
Thu, 12 November 2009 23:25 |
Steven Derrien Messages: 50 Registered: July 2009 |
Member |
|
|
Hi again,
Sebastian Zarnekow a écrit :
> Hi Steven,
>
> I guess you are mixing things up. Why do you need to import the ecore
> files in your grammar file _and_ in your workflow.
Maybe my example was not very clear ...
I don't import the ecore models in my DSL grammar, I import them in my
DSL instances (I want a DSL to manipulate meta-models).
> If the import mechanism works fine, there should be no need to import them in your
> workflow explicitly.
The import mecanism works fine since I can import ecore files in the
generated editor, and I can use content assist to cross-link to Eclass
objects defined in these imported ecore files.
As mentioned in the first mail, the problem arise when I want to use the
code generation MWE flow.
Xpand complains that it cannot find the EClasses that I cross link from
my DSL instance.
Hope my explanations are not too messy :/
> The consequence might by, that you end up with to instances of the same
> EPackage which may lead to different EClasses for the same name.
Thanks,
Steven
> Did you try to omit the import in the workflow file?
>
> Regards,
> Sebastian
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497477 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497481 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497487 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497489 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497490 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497500 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497502 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497510 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497515 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497517 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497527 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497532 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497539 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497547 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497558 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497578 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497593 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497594 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497626 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497627 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497628 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497629 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497645 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497655 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497665 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497672 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497684 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497698 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497705 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497710 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497714 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497715 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497716 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497719 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497723 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497729 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497732 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497735 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497766 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497771 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497785 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497790 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497796 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497803 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497808 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497812 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497814 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497817 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497818 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497828 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497837 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497840 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497845 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497848 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497863 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497877 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497879 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497883 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497896 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497897 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497919 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497927 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497932 is a reply to message #497260] |
Fri, 13 November 2009 07:18 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Steven,
you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.
You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).
To do so register the corresponding metaModel in the workflow like in
the following :
<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
....
</component>
Note that you'll have to switch from the simple namespaces to the java
ones :
<<IMPORT mypack>>
becomes
<<IMPORT org::my::javapackage>>
But that's basically all you'll have to do.
Cheers,
Sven
Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497933 is a reply to message #497932] |
Fri, 13 November 2009 10:45 |
Steven Derrien Messages: 50 Registered: July 2009 |
Member |
|
|
Hi Sven and Sebastian,
Thank you very much for your support, I really appreciate It.
After reading twice your posts, I am still not sure wether we understand
each other. I packaged a complete example that reproduce the problem I
am facing. It it here
http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip
Basically I want to write a DSL that is used to retarget code written
for a meta-model to anotherone by defining a mapping between Eclass
objects of these two meta-models.
Here is a summary the key elements :
**** The Xtext DSL grammar : mydsl.xtext *******
grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/MyDsl"
import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
TopLevel :
'mapping' name=ID '{'
(imports+=Import ';')*
(mappings+=Mapping)+
'}';
Mapping:
'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
Import :
'import' importURI=STRING;
**** An (correct) test file for this new DSL : model.mydsl ******
mapping test {
import
" platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
import
" platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";
from ASrcClass to BDstClass;
from BSrcClass to ADstClass;
}
**** EMFatic code for the metal models used in the example ****
@namespace(uri="http://source", prefix="source")
package source;
class ASrcClass {
attr String name ;
}
class BSrcClass {
attr String name ;
attr int value;
}
@namespace(uri="http://target", prefix="target")
package target;
class ADstClass {
attr String name ;
}
class BDstClass {
attr String name ;
attr int value;
}
**** An Xpand Template using the model build from model.mydsl ****
<<IMPORT myDsl>>;
<<EXTENSION templates::Extensions>>
<<DEFINE main FOR TopLevel->>
<<FILE "output.txt"->>
<<FOREACH this.mappings AS mapping>>
source is <<mapping.src.name>> .
destination is <<mapping.dst.name>> .
<<ENDFOREACH>>
<<ENDFILE->>
<<ENDDEFINE>>
**** The generator workflow ****
<workflow>
<property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
<property name="targetDir" value="src-gen"/>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="${targetDir}"/>
<component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
<register class="org.xtext.example.MyDslStandaloneSetup"/>
</component>
<component class="org.eclipse.xpand2.Generator">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<fileEncoding value="UTF-8"/>
<expand value="templates::Template::main FOR model"/>
<genPath value="${targetDir}"/>
</component>
</workflow>
**** The workflow execution log file ****
1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.2, Build v200908120417
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
workflow:
/home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri '/home/sderrien/workspace'
1343 [main] INFO e.core.container.CompositeComponent -
DirectoryCleaner: cleaning directory 'src-gen'
1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
/home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
1346 [main] INFO e.core.container.CompositeComponent - MweReader:
loading file from classpath:/model/MyModel.mydsl
1767 [main] INFO e.core.container.CompositeComponent - Generator:
generating 'templates::Template::main FOR model' => []
2091 [main] INFO org.eclipse.xpand2.Generator - Written 1 files
to outlet [default](src-gen/)
2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 750ms!
2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Diagnosis of
org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
test; Reported by: MweReader: loading file from
classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Imported resource could not be found.(Element:
org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Imported resource could not be found.(Element:
org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
Thanks in advance and Regards,
Steven
Sven Efftinge a écrit :
> Hi Steven,
>
> you don't need to tell Xpand about the imported ecore files.
> Xpand only needs to know about the types of any model elements.
> As you're working on ecore models you have to register ecore.
>
> You could either post the rest of your workflow file so we can help
> identifying the problem or just switch over to the JavaBeans-mode, which
> means that Xpand will work against Java types and not EClasses.
> The EMF-mode is only needed (and recommended) if you need to work
> against dynamic EMF. But in your case you have generated Java classes
> for all your model elements (which is your DSL's ecore model and ecore
> itself - not the imported ecore files!).
>
> To do so register the corresponding metaModel in the workflow like in
> the following :
>
> <component class="....Generator"/>
> <metaModel
> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>
> ....
> </component>
>
> Note that you'll have to switch from the simple namespaces to the java
> ones :
>
> <<IMPORT mypack>>
>
> becomes
>
> <<IMPORT org::my::javapackage>>
>
> But that's basically all you'll have to do.
>
> Cheers,
> Sven
>
> Steven Derrien schrieb:
>> Hi again,
>>
>> Sebastian Zarnekow a écrit :
>>> Hi Steven,
>>>
>>> I guess you are mixing things up. Why do you need to import the ecore
>>> files in your grammar file _and_ in your workflow.
>>
>> Maybe my example was not very clear ...
>>
>> I don't import the ecore models in my DSL grammar, I import them in my
>> DSL instances (I want a DSL to manipulate meta-models).
>>
>>> If the import mechanism works fine, there should be no need to import
>>> them in your workflow explicitly.
>>
>> The import mecanism works fine since I can import ecore files in the
>> generated editor, and I can use content assist to cross-link to Eclass
>> objects defined in these imported ecore files.
>>
>> As mentioned in the first mail, the problem arise when I want to use
>> the code generation MWE flow.
>>
>> Xpand complains that it cannot find the EClasses that I cross link
>> from my DSL instance.
>>
>> Hope my explanations are not too messy :/
>>
>>> The consequence might by, that you end up with to instances of the
>>> same EPackage which may lead to different EClasses for the same name.
>>
>> Thanks,
>>
>> Steven
>>> Did you try to omit the import in the workflow file?
>>>
>>> Regards,
>>> Sebastian
>
>
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497934 is a reply to message #497933] |
Fri, 13 November 2009 12:16 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Mmmhh looks ok.
There's a superfluos '/' in the platform:/resource URI.
I can imagine that the URI can not be resolved, because the underlying
URI map contains the entries with only one '/'.
I.e. try:
mapping test {
import
" platform:/resource/org.xtext.example.mydsl.generator/src/mod el/source.ecore ";
import
" platform:/resource/org.xtext.example.mydsl.generator/src/mod el/target.ecore ";
from ASrcClass to BDstClass;
from BSrcClass to ADstClass;
}
Steven Derrien schrieb:
> Hi Sven and Sebastian,
>
> Thank you very much for your support, I really appreciate It.
>
> After reading twice your posts, I am still not sure wether we understand
> each other. I packaged a complete example that reproduce the problem I
> am facing. It it here
>
> http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip
>
> Basically I want to write a DSL that is used to retarget code written
> for a meta-model to anotherone by defining a mapping between Eclass
> objects of these two meta-models.
>
> Here is a summary the key elements :
>
> **** The Xtext DSL grammar : mydsl.xtext *******
>
> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>
> generate myDsl "http://www.xtext.org/example/MyDsl"
>
> import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
>
> TopLevel :
> 'mapping' name=ID '{'
> (imports+=Import ';')*
> (mappings+=Mapping)+
> '}';
>
> Mapping:
> 'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
> Import :
> 'import' importURI=STRING;
>
>
> **** An (correct) test file for this new DSL : model.mydsl ******
>
> mapping test {
> import
> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
>
> import
> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";
>
>
> from ASrcClass to BDstClass;
> from BSrcClass to ADstClass;
> }
>
> **** EMFatic code for the metal models used in the example ****
>
> @namespace(uri="http://source", prefix="source")
> package source;
>
> class ASrcClass {
> attr String name ;
> }
>
> class BSrcClass {
> attr String name ;
> attr int value;
> }
>
>
> @namespace(uri="http://target", prefix="target")
> package target;
>
> class ADstClass {
> attr String name ;
> }
>
> class BDstClass {
> attr String name ;
> attr int value;
> }
>
>
> **** An Xpand Template using the model build from model.mydsl ****
>
>
> <<IMPORT myDsl>>;
>
> <<EXTENSION templates::Extensions>>
>
> <<DEFINE main FOR TopLevel->>
> <<FILE "output.txt"->>
>
> <<FOREACH this.mappings AS mapping>>
> source is <<mapping.src.name>> .
> destination is <<mapping.dst.name>> .
> <<ENDFOREACH>>
>
> <<ENDFILE->>
> <<ENDDEFINE>>
>
>
> **** The generator workflow ****
>
> <workflow>
> <property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
> <property name="targetDir" value="src-gen"/>
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>
>
> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
> directory="${targetDir}"/>
>
> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
> <register class="org.xtext.example.MyDslStandaloneSetup"/>
> </component>
>
> <component class="org.eclipse.xpand2.Generator">
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <fileEncoding value="UTF-8"/>
> <expand value="templates::Template::main FOR model"/>
> <genPath value="${targetDir}"/>
> </component>
> </workflow>
>
>
> **** The workflow execution log file ****
>
> 1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
> Workflow Engine 0.7.2, Build v200908120417
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
> openarchitectureware.org and contributors
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
> workflow:
> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
>
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> 540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
> platform uri '/home/sderrien/workspace'
> 1343 [main] INFO e.core.container.CompositeComponent -
> DirectoryCleaner: cleaning directory 'src-gen'
> 1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
> 1346 [main] INFO e.core.container.CompositeComponent - MweReader:
> loading file from classpath:/model/MyModel.mydsl
> 1767 [main] INFO e.core.container.CompositeComponent - Generator:
> generating 'templates::Template::main FOR model' => []
> 2091 [main] INFO org.eclipse.xpand2.Generator - Written 1 files
> to outlet [default](src-gen/)
> 2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
> completed in 750ms!
> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
> Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
> Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
> Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
> Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Diagnosis of
> org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
> test; Reported by: MweReader: loading file from
> classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Imported resource could not be found.(Element:
> org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Imported resource could not be found.(Element:
> org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>
> Thanks in advance and Regards,
>
> Steven
>
> Sven Efftinge a écrit :
>> Hi Steven,
>>
>> you don't need to tell Xpand about the imported ecore files.
>> Xpand only needs to know about the types of any model elements.
>> As you're working on ecore models you have to register ecore.
>>
>> You could either post the rest of your workflow file so we can help
>> identifying the problem or just switch over to the JavaBeans-mode,
>> which means that Xpand will work against Java types and not EClasses.
>> The EMF-mode is only needed (and recommended) if you need to work
>> against dynamic EMF. But in your case you have generated Java classes
>> for all your model elements (which is your DSL's ecore model and ecore
>> itself - not the imported ecore files!).
>>
>> To do so register the corresponding metaModel in the workflow like in
>> the following :
>>
>> <component class="....Generator"/>
>> <metaModel
>> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>>
>> ....
>> </component>
>>
>> Note that you'll have to switch from the simple namespaces to the java
>> ones :
>>
>> <<IMPORT mypack>>
>>
>> becomes
>>
>> <<IMPORT org::my::javapackage>>
>>
>> But that's basically all you'll have to do.
>>
>> Cheers,
>> Sven
>>
>> Steven Derrien schrieb:
>>> Hi again,
>>>
>>> Sebastian Zarnekow a écrit :
>>>> Hi Steven,
>>>>
>>>> I guess you are mixing things up. Why do you need to import the
>>>> ecore files in your grammar file _and_ in your workflow.
>>>
>>> Maybe my example was not very clear ...
>>>
>>> I don't import the ecore models in my DSL grammar, I import them in
>>> my DSL instances (I want a DSL to manipulate meta-models).
>>>
>>>> If the import mechanism works fine, there should be no need to
>>>> import them in your workflow explicitly.
>>>
>>> The import mecanism works fine since I can import ecore files in the
>>> generated editor, and I can use content assist to cross-link to
>>> Eclass objects defined in these imported ecore files.
>>>
>>> As mentioned in the first mail, the problem arise when I want to use
>>> the code generation MWE flow.
>>>
>>> Xpand complains that it cannot find the EClasses that I cross link
>>> from my DSL instance.
>>>
>>> Hope my explanations are not too messy :/
>>>
>>>> The consequence might by, that you end up with to instances of the
>>>> same EPackage which may lead to different EClasses for the same name.
>>>
>>> Thanks,
>>>
>>> Steven
>>>> Did you try to omit the import in the workflow file?
>>>>
>>>> Regards,
>>>> Sebastian
>>
>>
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
|
|
|
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497935 is a reply to message #497934] |
Fri, 13 November 2009 13:24 |
Steven Derrien Messages: 50 Registered: July 2009 |
Member |
|
|
Hi,
Sven Efftinge a écrit :
> Mmmhh looks ok.
> There's a superfluos '/' in the platform:/resource URI.
> I can imagine that the URI can not be resolved, because the underlying
> URI map contains the entries with only one '/'.
It works !
I didn't expected the problem to be a path issue, since the xtext
generated editor was happy with the import path I gave it.
Again, thanks you a lot for you help (also and for your great software)
Steven
> I.e. try:
>
> mapping test {
> import
> " platform:/resource/org.xtext.example.mydsl.generator/src/mod el/source.ecore ";
>
>
> import
> " platform:/resource/org.xtext.example.mydsl.generator/src/mod el/target.ecore ";
>
>
> from ASrcClass to BDstClass;
> from BSrcClass to ADstClass;
> }
>
>
> Steven Derrien schrieb:
>> Hi Sven and Sebastian,
>>
>> Thank you very much for your support, I really appreciate It.
>>
>> After reading twice your posts, I am still not sure wether we
>> understand each other. I packaged a complete example that reproduce
>> the problem I am facing. It it here
>>
>> http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip
>>
>> Basically I want to write a DSL that is used to retarget code written
>> for a meta-model to anotherone by defining a mapping between Eclass
>> objects of these two meta-models.
>>
>> Here is a summary the key elements :
>>
>> **** The Xtext DSL grammar : mydsl.xtext *******
>>
>> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>>
>> generate myDsl "http://www.xtext.org/example/MyDsl"
>>
>> import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
>>
>> TopLevel :
>> 'mapping' name=ID '{'
>> (imports+=Import ';')*
>> (mappings+=Mapping)+
>> '}';
>>
>> Mapping:
>> 'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
>> Import :
>> 'import' importURI=STRING;
>>
>>
>> **** An (correct) test file for this new DSL : model.mydsl ******
>>
>> mapping test {
>> import
>> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
>>
>> import
>> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";
>>
>>
>> from ASrcClass to BDstClass;
>> from BSrcClass to ADstClass;
>> }
>>
>> **** EMFatic code for the metal models used in the example ****
>>
>> @namespace(uri="http://source", prefix="source")
>> package source;
>>
>> class ASrcClass {
>> attr String name ;
>> }
>>
>> class BSrcClass {
>> attr String name ;
>> attr int value;
>> }
>>
>>
>> @namespace(uri="http://target", prefix="target")
>> package target;
>>
>> class ADstClass {
>> attr String name ;
>> }
>>
>> class BDstClass {
>> attr String name ;
>> attr int value;
>> }
>>
>>
>> **** An Xpand Template using the model build from model.mydsl ****
>>
>>
>> <<IMPORT myDsl>>;
>>
>> <<EXTENSION templates::Extensions>>
>>
>> <<DEFINE main FOR TopLevel->>
>> <<FILE "output.txt"->>
>>
>> <<FOREACH this.mappings AS mapping>>
>> source is <<mapping.src.name>> .
>> destination is <<mapping.dst.name>> .
>> <<ENDFOREACH>>
>>
>> <<ENDFILE->>
>> <<ENDDEFINE>>
>>
>>
>> **** The generator workflow ****
>>
>> <workflow>
>> <property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
>> <property name="targetDir" value="src-gen"/>
>>
>> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
>> platformUri=".."/>
>> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
>> directory="${targetDir}"/>
>> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
>> <register class="org.xtext.example.MyDslStandaloneSetup"/>
>> </component>
>> <component class="org.eclipse.xpand2.Generator">
>> <metaModel
>> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
>> <fileEncoding value="UTF-8"/>
>> <expand value="templates::Template::main FOR model"/>
>> <genPath value="${targetDir}"/>
>> </component>
>> </workflow>
>>
>>
>> **** The workflow execution log file ****
>>
>> 1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> ------------------------------------------------------------ --------------------------
>>
>> 24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
>> Workflow Engine 0.7.2, Build v200908120417
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
>> openarchitectureware.org and contributors
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> ------------------------------------------------------------ --------------------------
>>
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
>> workflow:
>> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
>>
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> 540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
>> platform uri '/home/sderrien/workspace'
>> 1343 [main] INFO e.core.container.CompositeComponent -
>> DirectoryCleaner: cleaning directory 'src-gen'
>> 1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
>> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
>> 1346 [main] INFO e.core.container.CompositeComponent - MweReader:
>> loading file from classpath:/model/MyModel.mydsl
>> 1767 [main] INFO e.core.container.CompositeComponent - Generator:
>> generating 'templates::Template::main FOR model' => []
>> 2091 [main] INFO org.eclipse.xpand2.Generator - Written 1
>> files to outlet [default](src-gen/)
>> 2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
>> completed in 750ms!
>> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
>> Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
>> Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
>> Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
>> Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Diagnosis of
>> org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
>> test; Reported by: MweReader: loading file from
>> classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Imported resource could not be found.(Element:
>> org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
>> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Imported resource could not be found.(Element:
>> org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
>> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>>
>> Thanks in advance and Regards,
>>
>> Steven
>>
>> Sven Efftinge a écrit :
>>> Hi Steven,
>>>
>>> you don't need to tell Xpand about the imported ecore files.
>>> Xpand only needs to know about the types of any model elements.
>>> As you're working on ecore models you have to register ecore.
>>>
>>> You could either post the rest of your workflow file so we can help
>>> identifying the problem or just switch over to the JavaBeans-mode,
>>> which means that Xpand will work against Java types and not EClasses.
>>> The EMF-mode is only needed (and recommended) if you need to work
>>> against dynamic EMF. But in your case you have generated Java classes
>>> for all your model elements (which is your DSL's ecore model and
>>> ecore itself - not the imported ecore files!).
>>>
>>> To do so register the corresponding metaModel in the workflow like in
>>> the following :
>>>
>>> <component class="....Generator"/>
>>> <metaModel
>>> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>>>
>>> ....
>>> </component>
>>>
>>> Note that you'll have to switch from the simple namespaces to the
>>> java ones :
>>>
>>> <<IMPORT mypack>>
>>>
>>> becomes
>>>
>>> <<IMPORT org::my::javapackage>>
>>>
>>> But that's basically all you'll have to do.
>>>
>>> Cheers,
>>> Sven
>>>
>>> Steven Derrien schrieb:
>>>> Hi again,
>>>>
>>>> Sebastian Zarnekow a écrit :
>>>>> Hi Steven,
>>>>>
>>>>> I guess you are mixing things up. Why do you need to import the
>>>>> ecore files in your grammar file _and_ in your workflow.
>>>>
>>>> Maybe my example was not very clear ...
>>>>
>>>> I don't import the ecore models in my DSL grammar, I import them in
>>>> my DSL instances (I want a DSL to manipulate meta-models).
>>>>
>>>>> If the import mechanism works fine, there should be no need to
>>>>> import them in your workflow explicitly.
>>>>
>>>> The import mecanism works fine since I can import ecore files in the
>>>> generated editor, and I can use content assist to cross-link to
>>>> Eclass objects defined in these imported ecore files.
>>>>
>>>> As mentioned in the first mail, the problem arise when I want to use
>>>> the code generation MWE flow.
>>>>
>>>> Xpand complains that it cannot find the EClasses that I cross link
>>>> from my DSL instance.
>>>>
>>>> Hope my explanations are not too messy :/
>>>>
>>>>> The consequence might by, that you end up with to instances of the
>>>>> same EPackage which may lead to different EClasses for the same name.
>>>>
>>>> Thanks,
>>>>
>>>> Steven
>>>>> Did you try to omit the import in the workflow file?
>>>>>
>>>>> Regards,
>>>>> Sebastian
>>>
>>>
>
>
|
|
| |
Goto Forum:
Current Time: Sat Dec 21 17:12:29 GMT 2024
Powered by FUDForum. Page generated in 0.13753 seconds
|