Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ebousse opened this issue Apr 26, 2017 · 1 comment

Comments

@ebousse
Copy link
Contributor

ebousse commented Apr 26, 2017

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)
}
@dvojtise
Copy link
Contributor

Additionnaly, only external language would make sense in case of mixed K3/Melange projects

For "normal / non external" languages, Melange copies the aspects in the runtime language. Thus the original aspect classes are useless when the language is deployed. they are used only at compilation time then at runtime only the copies are useful.

Inn case of external language, the contract is that the aspect doesn't changes the language signature, they only implements the predefined operations, thus the original aspect classes can be used.

dvojtise added a commit that referenced this issue May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants