importURI and importNamespace [message #818907] |
Mon, 12 March 2012 05:09  |
Eclipse User |
|
|
|
I have to import an external file, to solve cross-references, but I can't get it working.
I tried both importURI and importNamespace, changing the relative fragments in the workflow but:
with importURI, I get 'imported resource could not be found'.
with importNamespace, I get no errors on my import statement, but I get 'couldn't resolve reference' on my references.
How to get them right?
And, what's the correct syntax for the imported resource and the references?
From what I understand, references needn't be qualified names.
For resources, they can/must be java-like package names, URIs (including "platform:/..."?), absolute/relative paths?
|
|
|
|
Re: importURI and importNamespace [message #819685 is a reply to message #819288] |
Tue, 13 March 2012 03:39   |
Eclipse User |
|
|
|
Hi Christian, I didn't post my own example because I'm still stuck with the understanding of how imports work, so I don't know if it's my grammar that's problematic or it's just me not knowing how to do what I need.
Your example works for me, too. Now I think there's something automagical in the imports, which I just can't get. For namespaces: by importing other.*, what am I importing? Does Xtext look for an element named 'other'? Must it be the axiom of the grammar or can it be anything? And with other.xxx, must 'xxx' be an EAttribute with name 'name', placed inside the entity named 'other'? Can 'xxx' be an entity indirectly reachable from 'other' (i.e. via numerous references/attributes)? What does Xtext look for with '*': anything with a 'name', or just some of these entities?
I'm trying to build upon your example, but such insights would be very useful.
Thanks
P.S. if I reference an entity using a qualified id, will the same automagic happen (e.g. using 'other.Other' there would be no more need of 'import other.*')?
Is there some constraint like "the filename must match the name of its main entity"?
[Updated on: Tue, 13 March 2012 03:42] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03906 seconds