Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Conversion from oaw to tmf xtext - Problem with MetaModelRegistration
Conversion from oaw to tmf xtext - Problem with MetaModelRegistration [message #57688] Mon, 13 July 2009 16:04 Go to next message
Martin Kuhn is currently offline Martin KuhnFriend
Messages: 49
Registered: July 2009
Member
Hi,

I try to convert an "old" oaw xtext project to tmf xtext.

In this project I work with dynamic EMF and use the generated class with
the name "MetaModelRegistration" for these purposes.

In the new generated stuff this class is not available anymore. I know I
could rewrite the java stuff based on the static EMF which is now
generated. But I would prefer to get an intermediate solution.

What can I do to handle this problem?
TIA

Martin
Re: Conversion from oaw to tmf xtext - Problem with MetaModelRegistration [message #57741 is a reply to message #57688] Mon, 13 July 2009 18:37 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
The generated classes all inherit from EObject, so there shouldn't be a
problem using the reflective EObject API.

The MetaModelRegistration just made sure that the EPackage was put into
the EPackage.Registry.INSTANCE in standalone mode.
This is now done by the generated <MyLanguage>Setup class.

Sorry, if I didn't understand your question.

Regards,
Sven

Martin Kuhn schrieb:
> Hi,
>
> I try to convert an "old" oaw xtext project to tmf xtext.
>
> In this project I work with dynamic EMF and use the generated class with
> the name "MetaModelRegistration" for these purposes.
>
> In the new generated stuff this class is not available anymore. I know I
> could rewrite the java stuff based on the static EMF which is now
> generated. But I would prefer to get an intermediate solution.
> What can I do to handle this problem?
> TIA
>
> Martin
>
>
>
>
Re: Conversion from oaw to tmf xtext - Problem with MetaModelRegistration [message #58561 is a reply to message #57741] Tue, 14 July 2009 17:47 Go to previous message
Martin Kuhn is currently offline Martin KuhnFriend
Messages: 49
Registered: July 2009
Member
Sven Efftinge wrote:

> The generated classes all inherit from EObject, so there shouldn't be a
> problem using the reflective EObject API.

> The MetaModelRegistration just made sure that the EPackage was put into
> the EPackage.Registry.INSTANCE in standalone mode.
> This is now done by the generated <MyLanguage>Setup class.


Thanks for answering. I think this problem is solved.

Until now, we used OAW xtext intensively but without having a deep
understanding of internas.

BUT I realized that the migration is not an easy task. And without a
deeper knowledge it is a little bit tricky to solve the problems. (I get
tons of errors).

E.g. we had the following definition in our grammar:
String DataType:("string"|"integer"|"long"|...|"collection");

And changed to
DataType:("string"|"integer"|"long"|...|"collection");

Now we are not able to do a switch case with string on DataType Ref's:

e.g. the following doesn't work anymore
boolean isStringType(EntityAttribute this) :
// this.type points to a DataType
switch (this.type) {
case "string": true
case "text": true
default: false
};

How can I solve this problem?


Is there a documentation how to solve this kind of (common??) problems?

TIA
Martin
Previous Topic:No getter or adder for 'genmodels' (EcoreGeneratorFragment)
Next Topic:Re: Modifying Content assist, and notifying linking service
Goto Forum:
  


Current Time: Thu Dec 26 21:28:08 GMT 2024

Powered by FUDForum. Page generated in 0.04080 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top