melange icon indicating copy to clipboard operation
melange copied to clipboard

Cannot make Melange work on a MiniJava language

Open ebousse opened this issue 7 years ago • 3 comments

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:

  • org.tetrabox.minijava.xtext: a grammar-first xtext project, which generates the abstract syntax
  • org.tetrabox.minijava.semantics.modelstate: an additional metamodel that defines the execution state of a minijava program
  • org.tetrabox.minijava.semantics: semantics written only with K3 aspects (no new classes, no static classes)
  • org.tetrabox.minijava.dsl: the melange project, with the following melange file:
package org.tetrabox.minijava

 external language MiniJava { 
	syntax "platform:/resource/org.tetrabox.minijava.xtext/model/generated/MiniJava.ecore"
}

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 avatar Nov 08 '17 16:11 ebousse