Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to use EcoreSupport?
How to use EcoreSupport? [message #789880] Fri, 03 February 2012 14:28 Go to next message
Klaus Birken is currently offline Klaus BirkenFriend
Messages: 25
Registered: December 2009
Junior Member
Hi,

I am trying to reference entities from an ecore file from my Xtext DSL. The ecore file should be imported. Grammar snippet:

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

// ...
Import:  'import' importURI=STRING;
Entity:  'entity' ec=[ecore::EClass|ID];


The Xtext editor for the DSL doesn't know about the contents of the imported ecore file. How could this be done? I found the EcoreSupport class, but didn't get how to use it.

Thanks in advance, regards,
Klaus
Re: How to use EcoreSupport? [message #790167 is a reply to message #789880] Fri, 03 February 2012 22:41 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

the EcoreSupport class is only for use in a (Standalone) Mwe(2) Workflow
you problem is another one: the qualified name of an EClass is mypackage.MyEClass which is not parseable as an ID

=> you have to change the grammar to

Entity:  'entity' ec=[ecore::EClass|FQN];
FQN: ID ("." ID)*;


P.s: you might have to file scoping since stuff is exorted under http://my.package.nsuri.MyClass too

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:interface Literals is not generated
Next Topic:DSL Instance and Maven
Goto Forum:
  


Current Time: Fri Apr 26 17:53:21 GMT 2024

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

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

Back to the top