Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Dependencies between myDsl - Files
Dependencies between myDsl - Files [message #1698200] Fri, 12 June 2015 06:37 Go to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
I'm using a import mechanism to import elements of my dsl from other dsl-files.

...
QualifiedName:
   ID ('.' ID)*
;
 
Import:
   'Import' importedNamespace = QualifiedNameWithWildcard
;
  
QualifiedNameWithWildcard:
   QualifiedName '.*'?
;
...



...
Package mp.mpchat.coins.ichat
{
        Import mp.mpchat.types.*

        Interface IChat
    {
...


It's also possible to import elements from other projects in my workspace.

The problem is:

If i clean my Project in Eclipse IDE, my dsl-Files in depended projects cannot find elements from this file. In case of a build, everything is fine.
But, it's is not possible for my, to build my projects in the workspace on the command line, because the dependency problem. (I'm using cdt headless build)

I have also try to generate from my model without eclipse. (java -jar mygenerator.jar ...)

But the same problem. The other dsl-Files will be not found.

java -jar ../xxx_generator.jar IChat.mydsl
ERROR:Couldn't resolve reference to Entity 'ChatMessage'. (IChat.mydsl line : 10)
ERROR:Couldn't resolve reference to Entity 'ChatMessage'. (IChat.mydsl line : 15)
ERROR:Couldn't resolve reference to Entity 'ErrorCode'. (IChat.mydsl line : 16)
How can i configure the dependencys between many dsl-Files?

Thanks Simon

[Updated on: Fri, 12 June 2015 07:18]

Report message to a moderator

Re: Dependencies between myDsl - Files [message #1698207 is a reply to message #1698200] Fri, 12 June 2015 07:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
HI,

i standalone mode you have to add all resources to the resourceset manually


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Dependencies between myDsl - Files [message #1698210 is a reply to message #1698207] Fri, 12 June 2015 08:01 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Thank you Christian, but how?

In my Main.java i will call
 runGenerator(String string)
, the string is my dsl-File.

// load the resource
ResourceSet set = resourceSetProvider.get();
Resource resource = set.getResource(URI.createFileURI(string), true);


Any idea, how can i add the depends dsl File? FileList?

(Sorry, but i'm a newbie in java and xtend.)

Best regards
Simon
Re: Dependencies between myDsl - Files [message #1698212 is a reply to message #1698210] Fri, 12 June 2015 08:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
// you have to deliver depStrings
for (String depString : depStrings) {
set.getResource(URI.createFileURI(depString), true);
}

Resource resource = set.getResource(URI.createFileURI(string), true);


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Dependencies between myDsl - Files [message #1698235 is a reply to message #1698212] Fri, 12 June 2015 11:47 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Thanks, works fine!
Re: Dependencies between myDsl - Files [message #1698238 is a reply to message #1698235] Fri, 12 June 2015 11:56 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
One question: It's possible to say where the files will be generated?
Re: Dependencies between myDsl - Files [message #1698254 is a reply to message #1698238] Fri, 12 June 2015 14:34 Go to previous message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Done, thanks.
Previous Topic:Generate non text files
Next Topic:Left recursive type declarations in Xtext
Goto Forum:
  


Current Time: Tue Mar 19 10:04:10 GMT 2024

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

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

Back to the top