Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 1] How to serialize inter-model cross references, or, how to automatically generate input sta
[Xtext 1] How to serialize inter-model cross references, or, how to automatically generate input sta [message #813492] Mon, 05 March 2012 10:34
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
Hi all,

I have a problem when serializing a model containing inter-model
cross-references (only called cross-references in the following). The
model is created programmatically and it contains cross-references,
which is no problem as long as the model is stored as EMF/ecore model in
memory. However, when saving, aka serializing, the model, the
cross-references causes problems. XMI does not use the concept of
"import"-statements, however, my language uses this concept. That is,
an item X can be cross-referenced only, if it's scope/namespace is made
available via some import statement. Although I use a slightly different
mechanism, the problem should be similar to the importURI-feature of Xtext.

Since the code creating the model doesn't know anything about the
serializiation (from the generator point of view, the model is only an
ecore model), it cannot create import statements. Scope providers work
the other way round, that is, they return an EObject for a given name.

What I need is some mechanism for automatically adding import-like
statements, when a cross-reference requires that statement. Is this
possible, or do I have to extend my grammar in order to support fully
qualified names? And how do I distinguish between simple names and fully
qualified names when serializing a model?

Previous Topic:Formatting my Xtext Language
Next Topic:Running / Interpret the DSL
Goto Forum:

Current Time: Tue Apr 07 21:32:41 GMT 2020

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

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

Back to the top