Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Supertype from referenced ecore model
icon5.gif  Supertype from referenced ecore model [message #692500] Mon, 04 July 2011 15:25 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: March 2010
Junior Member
Hi,

I have an ecore model and an xtext grammar. I want one of the types defined with xtext to extend a type from my ecore model. Is this possible?

Thanks for your help.
Re: Supertype from referenced ecore model [message #692502 is a reply to message #692500] Mon, 04 July 2011 15:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hi, yes this is possible e.g.

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/emf/2002/Ecore" as ecore

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model returns ecore::EClass:
	{Model} name=ID;



~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Supertype from referenced ecore model [message #692506 is a reply to message #692502] Mon, 04 July 2011 15:44 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: March 2010
Junior Member
Hi,

thanks for the quick answer.

I tried something like this, but it didn't work.

I referenced my ecore via platform resource uri:

"import 'platform:/resource/org.testmodel/model/testmodel.ecore' as testmodel"

But when typing "Model returns testmodel::TestType:[...]", the compiler says:

- Cannot create type 'TestType' in alias testmodel
- Couldn't resolve reference to EClassifier 'TestType'.
Re: Supertype from referenced ecore model [message #692507 is a reply to message #692506] Mon, 04 July 2011 15:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

are you sure TestType is contained in testmodel and an EClass?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:'Cannot find type' error
Next Topic:appending text programmatically.
Goto Forum:
  


Current Time: Thu Mar 28 21:46:17 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