|
@@ -28,7 +28,7 @@ Element function ramify_func(model : Element, prepost : String):
|
|
|
instantiate_node(new_model, "Class", "String")
|
|
|
|
|
|
// Add in the complete AL metamodel
|
|
|
- add_AL(new_model)
|
|
|
+ add_AL_to_MM(new_model)
|
|
|
|
|
|
// Add some default elements
|
|
|
if (is_pre):
|
|
@@ -72,7 +72,7 @@ Element function ramify_func(model : Element, prepost : String):
|
|
|
instantiate_attribute(new_model, "LHS_contains", "name", "contains")
|
|
|
|
|
|
// Association NAC_contains (NAC, Pre_Element) {}
|
|
|
- instantiate_link(new_model, "Association", "NAC", "Pre_Element")
|
|
|
+ instantiate_link(new_model, "Association", "NAC_contains", "NAC", "Pre_Element")
|
|
|
instantiate_attribute(new_model, "NAC_contains", "name", "contains")
|
|
|
|
|
|
inheritor = "Pre_Element"
|
|
@@ -128,17 +128,20 @@ Element function ramify_func(model : Element, prepost : String):
|
|
|
append = "Post_"
|
|
|
|
|
|
keys = dict_keys(old_m)
|
|
|
+ String type_name
|
|
|
+ String old_source
|
|
|
+ String old_target
|
|
|
while (read_nr_out(keys) > 0):
|
|
|
key = set_pop(keys)
|
|
|
entry = old_m[key]
|
|
|
|
|
|
- type_name = reverseKeyLookup(old_model["metamodel"]["model"], dict_read_node(old_model["type_mapping"], entry))
|
|
|
+ type_name = reverseKeyLookup(model["metamodel"]["model"], dict_read_node(model["type_mapping"], entry))
|
|
|
if (type_name == "Class"):
|
|
|
instantiate_node(new_model, type_name, append + key)
|
|
|
|
|
|
elif (bool_or(type_name == "Association", type_name == "Inheritance")):
|
|
|
- old_source = reverseKeyLookup(old_model["model"], read_edge_src(entry))
|
|
|
- old_target = reverseKeyLookup(old_model["model"], read_edge_dst(entry))
|
|
|
+ old_source = reverseKeyLookup(model["model"], read_edge_src(entry))
|
|
|
+ old_target = reverseKeyLookup(model["model"], read_edge_dst(entry))
|
|
|
instantiate_link(new_model, type_name, append + key, append + old_source, append + old_target)
|
|
|
|
|
|
// 1) Make it inherit from the Root Element (Pre_Element or Post_Element)
|
|
@@ -150,13 +153,13 @@ Element function ramify_func(model : Element, prepost : String):
|
|
|
// An instance link, so just copy over (don't make element of Root Element), and don't even copy if it is lower cardinality
|
|
|
// It is probably an attribute at the meta-language level, so check which one it is
|
|
|
String name
|
|
|
- name = cast_v2s(read_attribute(old_model["metamodel"], type_name, "name"))
|
|
|
+ name = cast_v2s(read_attribute(model["metamodel"], type_name, "name"))
|
|
|
if (bool_not(bool_or(bool_or(name == "lower_cardinality", name == "source_lower_cardinality"), name == "target_lower_cardinality"))):
|
|
|
// Not a lower cardinality, so copy
|
|
|
- source = reverseKeyLookup(old_model["model"], read_edge_src(entry))
|
|
|
- instantiate_attribute(new_model, source, name, read_edge_dst(entry))
|
|
|
+ old_source = reverseKeyLookup(model["model"], read_edge_src(entry))
|
|
|
+ instantiate_attribute(new_model, append + old_source, append + name, read_edge_dst(entry))
|
|
|
|
|
|
- return new_model
|
|
|
+ return new_model!
|
|
|
|
|
|
Element function ramify(model : Element):
|
|
|
Element rv
|