|
@@ -136,6 +136,31 @@ Element function getAttributeList(model : Element, element : String):
|
|
|
|
|
|
return result!
|
|
|
|
|
|
+Element function getAttributes(model : Element, element : String):
|
|
|
+ Element result
|
|
|
+ Element keys
|
|
|
+ Element type
|
|
|
+ Element attr_name
|
|
|
+ Element types
|
|
|
+ Element mm
|
|
|
+
|
|
|
+ result = dict_create()
|
|
|
+ mm = model["metamodel"]["model"]
|
|
|
+ types = get_superclasses(model["metamodel"], read_type(model, element))
|
|
|
+
|
|
|
+ while (set_len(types) > 0):
|
|
|
+ type = set_pop(types)
|
|
|
+
|
|
|
+ // Add our own attributes
|
|
|
+ keys = dict_keys(mm[type])
|
|
|
+ while (set_len(keys) > 0):
|
|
|
+ attr_name = set_pop(keys)
|
|
|
+ if (is_physical_string(attr_name)):
|
|
|
+ // WARNING: do not change this to dict_add_fast, as this crashes random code...
|
|
|
+ dict_add(result, attr_name, read_attribute(model, element, attr_name))
|
|
|
+
|
|
|
+ return result!
|
|
|
+
|
|
|
Element function getInstantiatableAttributes(model : Element, element : String, type : String):
|
|
|
Element all_links
|
|
|
Element result
|