Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » cross reference into other DSL files(How does it work, if ..)
cross reference into other DSL files [message #1031485] Mon, 01 April 2013 20:46 Go to next message
Bodo Koch is currently offline Bodo KochFriend
Messages: 8
Registered: February 2012
Junior Member
How one can use the cross refence system with several files in the same folder?

I use them like this: Type: 'TYPE' name = ID ...; and then the reference in Var: 'VAR varName=ID ':' type=[Type] ';'. This works fine if the definition and the reference are in the same file, but my DSL uses several files and I chouldn't manage to get it work.

I use xtext 2.4
Re: cross reference into other DSL files [message #1031532 is a reply to message #1031485] Mon, 01 April 2013 22:31 Go to previous messageGo to next message
Fabian G. is currently offline Fabian G.Friend
Messages: 60
Registered: May 2010
Location: Christchurch (NZ)
Member
Hi,

you mean in your dsl files? this is just a question of import/export settings (look at the mwe workflow file). You can export everything in the same namespace by default, or extend the scopeprovider (to define filter, for instance). See in the doc how the importURI / importedNamespace features work.

Fabian
Re: cross reference into other DSL files [message #1031741 is a reply to message #1031532] Tue, 02 April 2013 06:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

a common misstake if that type=[Type] is short for type=[Type|ID] and you actually might have to
(a) use imports
(b) change it to type=[Type|FQN]
with FQN: ID ("." ID)*;


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: cross reference into other DSL files [message #1031917 is a reply to message #1031741] Tue, 02 April 2013 11:19 Go to previous messageGo to next message
Bodo Koch is currently offline Bodo KochFriend
Messages: 8
Registered: February 2012
Junior Member
Hi,

thank you very much. But using an import statement in this DSL is a no go! We just want the same feature as it works for java files in the same folder. Each class name is known in every other classes. No extra import. The DSL-Files are generated from an other tool. This tool can't be changed and for each application up to 100 DLS-Files are generated.

@fabian: OK, but I do not know much about the MWE files. Are there a common solution, some where? I guess, this kind of type-referencing may be very common. But any way, I will try to google your suggestion.

Bodo
Re: cross reference into other DSL files [message #1031923 is a reply to message #1031917] Tue, 02 April 2013 11:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

as said before: it works out of the box. if not it has todo how your grammar is like (e.g. names)

=> No reproducable grammar no concrete Help


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: cross reference into other DSL files [message #1032593 is a reply to message #1031923] Wed, 03 April 2013 07:27 Go to previous message
Bodo Koch is currently offline Bodo KochFriend
Messages: 8
Registered: February 2012
Junior Member
Hi Christian,

thx for your hint! Now it works also for me. The reason was, the extensions I give was 'exp' but the real extensions of the (existings) files was 'EXP'. I expected, that the system doesn't care about character case, but it did. So I defined a fresh new DSL with extension 'EXP' and .... hurray!

Bodo
Previous Topic:Cross Referencing with a different attribute of a rule
Next Topic:XText and maven build with modified Generator
Goto Forum:
  


Current Time: Fri Mar 29 08:20:27 GMT 2024

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

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

Back to the top