k3
k3 copied to clipboard
"K3 Project" wizard with "User Ecore Basic Aspects With Melange" template leads to invalid Melange file
When creating a new "K3 Project" with the "User Ecore Basic Aspects With Melange" template, the generated melange file has several problems, including:
- a wrong import (
MetamodelExtensions
does not exist anymore):import static extension fr.inria.diverse.melange.lib.MetamodelExtensions.*
- outdated keywords, such as
metamodel
(instead oflanguage
) orecore
(instead ofsyntax
) - an error in the transformations on
MyMetamodelMT
that "cannot be resolved as a type, even after generating the language runtime, for some reason
Example:
package packageName
import static extension fr.inria.diverse.melange.lib.MetamodelExtensions.*
metamodel MyMetamodel {
ecore "platform:/resource//as/model/My.ecore"
exactType MyMetamodelMT
}
transformation execute(MyMetamodelMT mymodel) {
val root = mymodel.contents.head as MyMetamodel
print("root: ")
println(root)
}
@Main
transformation main() {
val m1 = MyMetamodel.load("input/Simple.xmi", MyMetamodelMT)
execute.call(m1)
}