Generating DSL2 files from DSL1 [message #1731395] |
Wed, 04 May 2016 23:02 |
Miguel Jimenez Messages: 40 Registered: July 2015 |
Member |
|
|
Hello,
I developed two DSLs, DSL1 and DSL2. When DSL1 is installed, DSL2 is also installed. I solved this by requiring DSL2.dsl, DSL2.ide, and DSL2.ui in the DSL1's feature.xml, is that the right way of doing it? Each DSL has its own update site.
Now, DSL1 generates java files but also .dsl2 files (files recognized by DSL2). It does that in dsl1-gen directory.
The problem is that code generation is not automatically triggered for those files, so the java code from .dsl2 files is not generated in dsl2-gen. The .dsl2 files show errors because (I guess) Xbase uses the generated code to validate things.
Is this a common use case? What would be a possible way to solve this? Until now, the user needs to open each DSL2 derived file, modify it and save, so the java files can be generated.
|
|
|
|
Re: Generating DSL2 files from DSL1 [message #1731893 is a reply to message #1731836] |
Tue, 10 May 2016 16:56 |
Miguel Jimenez Messages: 40 Registered: July 2015 |
Member |
|
|
Hi Jan,
Yes, both DSLs use XBase and they both implement a Model inferrer. Although DSL1 also uses a generator, to generate .dsl2 files.
Suppose these snippets correspond to the generated .dsl2 files:
package org.example
subsystem Server {
}
package org.example
depends on Server
subsystem Client {
}
When the user opens Client.dsl2, the editor shows an error in line 2 ("depends on Server") because Server is not recognized/validated/etc. When the user modify and save these files (for example, add an empty space), DSL2 generates the corresponding java classes in dsl2-gen, and everything works ok.
Is there a way to trigger this generation so the user does not have to do it manually?
[Updated on: Tue, 10 May 2016 16:57] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03689 seconds