Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to use types defined in other Ecore files in my DSL
icon5.gif  how to use types defined in other Ecore files in my DSL [message #997592] Tue, 08 January 2013 09:04 Go to previous message
Barbara Xiong is currently offline Barbara Xiong
Messages: 4
Registered: December 2012
Junior Member
Hi,

I want to use data types defined in a Ecore named ModelTypes in my DSL.

And I suppose it is the same theory as using Java types in one's own DSL. So I follow the steps in the document of Xtext about how to use Java type

here is my DSL:
import "platform:/resource/ModelTypes.ecore" as ModelTypes

Program:
       'var' modeltype=MTypes 
;

Mtypes:
       a=[ModelTypes::TypeA]|b=[ModelTypes::TypeB]
;


then I add the referencedGenModels and TypesGeneratorFragment in the workflow

However, in the editor, when i write:
var TypeA


there exists an error, which suggested that Couldn't resolve reference to ModelTypes 'TypeA'

What can i do to use data types defined in a Ecore in my DSL?
TIA!
 
Read Message icon5.gif
Read Message
Previous Topic:file updates and rebuilds.
Next Topic:Using toIterable.FindFirst in Generator
Goto Forum:
  


Current Time: Sun May 26 04:33:43 EDT 2013

Powered by FUDForum. Page generated in 0.01680 seconds