Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to call a model from another model
How to call a model from another model [message #1406890] Mon, 11 August 2014 11:17 Go to next message
cheney cao is currently offline cheney caoFriend
Messages: 5
Registered: August 2014
Junior Member
Hi All,

I'm a beginner of xtext/xtend. Now I create one xtext project (A) for some setup file (*.a). Then I can follow some grammar to new some data definitions in *.a files.

Now I create another xtext project(B), and new xtext editor will be *.b. In *.b file, I hope I can use the data which are defined in *.a. But actually I only can get the BModel based on this *.b editor file.

if i can:
1. directly get the object of AModel, and then all data defined in *.a file could be read in *.b?

2. Access the A grammar to re-create data structure (import *.a file firstly) and then use it by AGrammarAccess or GrammarUtil or something else way?

Thanks in advance~~~
Re: How to call a model from another model [message #1407169 is a reply to message #1406890] Tue, 12 August 2014 03:01 Go to previous messageGo to next message
cheney cao is currently offline cheney caoFriend
Messages: 5
Registered: August 2014
Junior Member
Is there anybody can give me help?

I just want to use the content assist on B project *.b editor, which can refer to data defined in *.a.
Re: How to call a model from another model [message #1407208 is a reply to message #1407169] Tue, 12 August 2014 05:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i am not sure what your problem is. did you have a look at http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to call a model from another model [message #1407213 is a reply to message #1407208] Tue, 12 August 2014 05:25 Go to previous messageGo to next message
cheney cao is currently offline cheney caoFriend
Messages: 5
Registered: August 2014
Junior Member
Thank you very much for your reply.

firstly I cannot access your link above.

For my problem, I can simply explain it again.

I create a xtext project A, the file extension could be *.a, and another xtext project B, the file extension could be *.b, now in a Eclipse workcenter *.a and *.b both can accessed. but I need to edit in *.b file and want to use content assist to access all available data which are defined in *.a files.

Is that more clear for you??
Re: How to call a model from another model [message #1407257 is a reply to message #1407213] Tue, 12 August 2014 07:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
if " content assist to access all available data which are defined in *.a files." == referncing then this is described in my blog.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to call a model from another model [message #1408434 is a reply to message #1407257] Fri, 15 August 2014 03:26 Go to previous message
cheney cao is currently offline cheney caoFriend
Messages: 5
Registered: August 2014
Junior Member
Hi Christian,

thanks very much for your reply. I think maybe I should find more cross reference topics.

Regards,
Cheney
Previous Topic:completion proposal not work for nested XExpression
Next Topic:Why Xtext is better than ANTLR
Goto Forum:
  


Current Time: Fri Apr 19 02:30:24 GMT 2024

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

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

Back to the top