blob: bf798b0f1c5e623bc108bcfc877eb6965361149e [file] [log] [blame]
var emfTool = new Native("");
var ecoreUtil = emfTool.ecoreUtil;
var m = new Target!Model;
for (c in Source!Cloneable.all) {
for (i in {
// Create a clone of c. When created,
// the clone doesn't belong to any model.
var targetCloneable = ecoreUtil.copy(c);
// Important: before accessing any properties of
// the cloned object, you need to add it to one
// of the involved models. For example, if the
// two following statements are put in reverse
// order, it won't work.
m.contents.add(targetCloneable); = + i;