Referencing external resources [message #871852] |
Tue, 15 May 2012 02:12 |
|
Hello!
I have a simple beginners question: I have model instances of language 'A' that I want to decorate with a new language ('B'). The xText grammar consequently imports and resolves metamodel 'A'.
Now I would like to refer (cross-reference) to elements of 'A' within the 'B' instances. This means I need a notation that allows to define the location of the resource. It would allow me to write something like:
ObjectInB dependsOn ObjectInA<file:///C:/temp/aResources/theArequired.aStoreFile>
EMFText accomplishes it in
this way.
Help appreciated, as this is a project blocker...
Thanks, JG
|
|
|
|
Re: Referencing external resources [message #871923 is a reply to message #871906] |
Tue, 15 May 2012 06:37 |
|
Sorry for not being imprecise/fuzzy in my description of the issue. I understand cross referencing, but my question is really about resource loading, as described in the question below. I am looking for an xText grammar language construct that is equivalent to a 'load the resource into resource set' command, so I can access model elements in a different file. EMFText does this by allowing the user to directly enter the URL of the resource to load. Doex xText do the same?
==== below a more explicit rephrase of my question by W. ====
> Hi,
> Assume that a meta model has been created and a tree based editor has
> been generated (or a dynamic instance is created using the reflective
> editor). In these situations eclipse provides the ability to load
> additional resources which enables referring to their contents from the
> model in the editor.
> How should that best be realized using EMFText? Prefereably, I'd like to
> have the ability to 'load a resource' in a similar fashion. Or is there
> a way to 'include' or 'import' an additional model without polluting the
> meta model and/or textual concrete syntax?
> Greetings,
> Wilbert.
|
|
|
|
Re: Referencing external resources [message #871936 is a reply to message #871923] |
Tue, 15 May 2012 07:20 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Jörn,
Xtext maintains an index of all available model resources thus renders
the need for explicit uri usages unnecessary.
Instead of
resourceA.entity
entity Subject {}
resourceB.entity
entity Person extends Subject<resourceA> {}
you'll just use
somewhere.entity
entity Subject {}
myfile.entity
entity Person extends Subject {}
and the framework will figure out autoamtically where Subject is contained.
Does that answer your question?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 15.05.12 08:37, schrieb Jörn Guy Süß:
> Sorry for not being imprecise/fuzzy in my description of the issue. I
> understand cross referencing, but my question is really about resource
> loading, as described in the question below. I am looking for an xText
> grammar language construct that is equivalent to a 'load the resource
> into resource set' command, so I can access model elements in a
> different file. EMFText does this by allowing the user to directly enter
> the URL of the resource to load. Doex xText do the same?
>
> ==== below a more explicit rephrase of my question by W. ====
>> Hi,
>> Assume that a meta model has been created and a tree based editor has
>> been generated (or a dynamic instance is created using the reflective
>> editor). In these situations eclipse provides the ability to load
>> additional resources which enables referring to their contents from the
>> model in the editor.
>> How should that best be realized using EMFText? Prefereably, I'd like to
>> have the ability to 'load a resource' in a similar fashion. Or is there
>> a way to 'include' or 'import' an additional model without polluting the
>> meta model and/or textual concrete syntax?
>> Greetings,
>> Wilbert.
|
|
|
Powered by
FUDForum. Page generated in 0.32766 seconds