|
@@ -106,9 +106,6 @@ Element function allIncomingAssociationInstances(model : Element, target_name :
|
|
|
i = i + 1
|
|
|
return result
|
|
|
|
|
|
-Element function readElementByName(model : Element, name : String):
|
|
|
- return model["model"][name]
|
|
|
-
|
|
|
Element function getAttributeList(model : Element, element : String):
|
|
|
Element result
|
|
|
Element keys
|
|
@@ -132,11 +129,13 @@ Element function getAttributeList(model : Element, element : String):
|
|
|
|
|
|
return result
|
|
|
|
|
|
-Element function getInstantiatableAttributes(model : Element, element : Element):
|
|
|
+Element function getInstantiatableAttributes(model : Element, element : String):
|
|
|
Element result
|
|
|
result = create_node()
|
|
|
// Get all outgoing "dictionary" links
|
|
|
Element set_own
|
|
|
+ Element elem
|
|
|
+ elem = model["model"][element]
|
|
|
set_own = dict_keys(element)
|
|
|
|
|
|
// Filter them
|
|
@@ -148,20 +147,10 @@ Element function getInstantiatableAttributes(model : Element, element : Element)
|
|
|
|
|
|
return result
|
|
|
|
|
|
-String function getName(m : Element, e : Element):
|
|
|
- Element element_keys
|
|
|
- Element s
|
|
|
- s = m["model"]
|
|
|
- element_keys = dict_keys(s)
|
|
|
-
|
|
|
- Element key
|
|
|
- while (0 < read_nr_out(element_keys)):
|
|
|
- key = set_pop(element_keys)
|
|
|
- if (element_eq(dict_read_node(s, key), e)):
|
|
|
- return key
|
|
|
-
|
|
|
- return string_join(string_join("(unknown: ", cast_e2s(e)), " )")
|
|
|
+String function getName(model : Element, element : Element):
|
|
|
+ return reverseKeyLookup(model["model"], element)
|
|
|
|
|
|
+// Utility functions!
|
|
|
String function reverseKeyLookup(dict : Element, element : Element):
|
|
|
Element elements
|
|
|
String name
|