diverse-project / melange

The Melange Language Workbench
http://melange-lang.org
Eclipse Public License 1.0
28 stars 7 forks source link

Cannot make Melange work on a MiniJava language #97

Open ebousse opened 7 years ago

ebousse commented 7 years ago

I feel bad for opening an issue for a very unprecise and not well identified problem, but here I go...

I am working on a MiniJava language, available here: https://github.com/tetrabox/minijava

Most importantly, it contains:

language XMiniJava inherits MiniJava {

syntax "platform:/resource/org.tetrabox.minijava.semantics.modelstate/model/MiniJavaDynamicData.ecore" renaming {
    "minijavadynamicdata" to "miniJava"
}
with  org.tetrabox.minijava.semantics.* 

}



When starting "Generate All" on the melange file, no error message appears, but several problems occur:
- sometimes, the code generated from the metamodel of the generated language runtime has errors
- sometimes,  the metamodel of the generated language runtime has errors
- always: most of the code that should be generated in `org.tetrabox.minijava.dsl/src-gen` is missing, eg. adapters, the classes that represent the languages and the model types, etc.

In the end, some projects have errors, and the melange file always have the warning "Cannot find EMF runtime for XMiniJava".

**If anyone has any idea of what I am doing wrong, or of what Melange is doing wrong, or of any workaround that I could use, I would be extremely interested :(** 
ebousse commented 7 years ago

Also a quick note, the renaming is used as a workaround to two bugs that occur when no renaming is used to merge both packages into a single one:

So in fact it would also be great to have this example work without the use of renaming.

tdegueul commented 7 years ago

"Works for me" :(. I can successfully generate everything (runtime language, adapters, interfaces, etc.).

I'm working outside GEMOC: Eclipse Modeling + latest Melange.

Could you please try to update to the latest version of Melange in your GEMOC installation and report back?

https://ci.inria.fr/k3al/job/melange-master/lastSuccessfulBuild/artifact/releng/fr.inria.diverse.melange.p2updatesite/target/site/.

ebousse commented 7 years ago

OK, I confirm that is now works well with master, for some reason. Thanks all!

However, I still have several errors when I remove the renaming in the melange file, due to the Eclass Symbol being generated twice for some reason (one per EPackage).

Originally it only exists in the miniJava epackage, in the abstract syntax: capture d ecran de 2017-11-13 14-19-08

But after running Generate All, it can be found in both resulting epackages: capture d ecran de 2017-11-13 14-15-06

If you want I can create a separate issue for this problem, but it's up to you.