|
@@ -114,13 +114,14 @@ Element function getAttributeList(model : Element, element : String):
|
|
|
|
|
|
while (read_nr_out(types) > 0):
|
|
|
type = set_pop(types)
|
|
|
- keys = dict_keys(model["metamodel"]["model"][type])
|
|
|
|
|
|
// Add our own attributes
|
|
|
- while (0 < list_len(keys)):
|
|
|
+ keys = dict_keys(model["metamodel"]["model"][type])
|
|
|
+ while (read_nr_out(keys) > 0):
|
|
|
attr_name = set_pop(keys)
|
|
|
if (is_physical_string(attr_name)):
|
|
|
attr_type = reverseKeyLookup(model["metamodel"]["model"], model["metamodel"]["model"][type][attr_name])
|
|
|
+ // WARNING: do not change this to dict_add_fast, as this crashes random code...
|
|
|
dict_add(result, attr_name, attr_type)
|
|
|
|
|
|
return result!
|
|
@@ -137,35 +138,11 @@ Element function getInstantiatableAttributes(model : Element, element : String):
|
|
|
all_links = allOutgoingAssociationInstances(model, element, "Attribute")
|
|
|
while (read_nr_out(all_links) > 0):
|
|
|
link = set_pop(all_links)
|
|
|
+ // WARNING: do not change this to dict_add_fast, as this crashes random code...
|
|
|
dict_add(result, read_attribute(model, link, "name"), read_type(model, readAssociationDestination(model, link)))
|
|
|
|
|
|
return result!
|
|
|
|
|
|
-Element function getInstantiatableAttributes_old(model : Element, element : String):
|
|
|
- Element result
|
|
|
- result = create_node()
|
|
|
-
|
|
|
- Element types
|
|
|
- types = get_superclasses(model, element)
|
|
|
-
|
|
|
- while (read_nr_out(types) > 0):
|
|
|
- element = set_pop(types)
|
|
|
-
|
|
|
- // Get all outgoing "dictionary" links
|
|
|
- Element set_own
|
|
|
- Element elem
|
|
|
- elem = model["model"][element]
|
|
|
- set_own = dict_keys(elem)
|
|
|
-
|
|
|
- // Filter them
|
|
|
- Element e
|
|
|
- while (0 < read_nr_out(set_own)):
|
|
|
- e = set_pop(set_own)
|
|
|
- if (is_physical_string(e)):
|
|
|
- dict_add(result, e, reverseKeyLookup(model["model"], elem[e]))
|
|
|
-
|
|
|
- return result!
|
|
|
-
|
|
|
String function reverseKeyLookup(dict : Element, element : Element):
|
|
|
Integer nr_in
|
|
|
Integer nr_out
|