|
|
@@ -23,10 +23,18 @@ Boolean function main(model : Element):
|
|
|
|
|
|
Element instances
|
|
|
String instance
|
|
|
- instances = allInstances(model, "type_mapping/Instance")
|
|
|
- while (set_len(instances) > 0):
|
|
|
- instance = set_pop(instances)
|
|
|
- dict_add(type_mapping, "model/" + string_replace(instance, "type_mapping/instance_", ""), "metamodel/" + string_replace(set_pop(allAssociationDestinations(model, instance, "type_mapping/TypeLink")), "type_mapping/type_", ""))
|
|
|
+ type_mapping = model["model"][set_pop(allInstances(model, "type_mapping/Root"))]
|
|
|
+
|
|
|
+ Element new_type_mapping
|
|
|
+ Element keys
|
|
|
+ String key
|
|
|
+ new_type_mapping = dict_create()
|
|
|
+ keys = dict_keys(type_mapping)
|
|
|
+ while (set_len(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ dict_add(new_type_mapping, "model/" + key, "metamodel/" + cast_string(type_mapping[key]))
|
|
|
+
|
|
|
+ type_mapping = new_type_mapping
|
|
|
|
|
|
// Check if each attribute is there, and satisfies the constraints
|
|
|
instances = dict_keys(type_mapping)
|
|
|
@@ -36,7 +44,7 @@ Boolean function main(model : Element):
|
|
|
// Got an instance of a Class
|
|
|
String type
|
|
|
Element inherits_from
|
|
|
- type = type_mapping[instance]
|
|
|
+ type = cast_string(type_mapping[instance])
|
|
|
|
|
|
Element outgoing_links
|
|
|
String outgoing_link
|