k3 icon indicating copy to clipboard operation
k3 copied to clipboard

"K3 Project" wizard with "User Ecore Basic Aspects With Melange" template leads to invalid Melange file

Open ebousse opened this issue 7 years ago • 1 comments

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 of language) or ecore (instead of syntax)
  • 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)
}

ebousse avatar Apr 26 '17 09:04 ebousse