|
@@ -203,6 +203,42 @@ Element function modify(model : Element, write : Boolean):
|
|
|
else:
|
|
|
output("Permission denied")
|
|
|
|
|
|
+ elif (cmd == "nice_list"):
|
|
|
+ Element keys_m
|
|
|
+ String type
|
|
|
+ String v_m
|
|
|
+ Element attr_list
|
|
|
+ Element attr_keys
|
|
|
+ String attr_key
|
|
|
+
|
|
|
+ keys_m = dict_keys(model["model"])
|
|
|
+
|
|
|
+ while (read_nr_out(keys_m) > 0):
|
|
|
+ v_m = set_pop(keys_m)
|
|
|
+ type = read_type(model["metamodel"], read_type(model, v_m))
|
|
|
+
|
|
|
+ if (bool_or(type == "Class", type == "Association")):
|
|
|
+ output(((" " + v_m) + " : ") + read_type(model, v_m))
|
|
|
+ if (type == "Association"):
|
|
|
+ output(((" " + reverseKeyLookup(model["model"], read_edge_src(model["model"][v_m]))) + " --> ") + reverseKeyLookup(model["model"], read_edge_dst(model["model"][v_m])))
|
|
|
+
|
|
|
+ // Defines attributes
|
|
|
+ attr_list = getInstantiatableAttributes(model, v_m)
|
|
|
+ attr_keys = dict_keys(attr_list)
|
|
|
+ while (0 < read_nr_out(attr_keys)):
|
|
|
+ attr_key = set_pop(attr_keys)
|
|
|
+ output((((" " + attr_key) + " : ") + cast_v2s(attr_list[attr_key])))
|
|
|
+
|
|
|
+ // Has attributes
|
|
|
+ attr_list = getAttributeList(model, v_m)
|
|
|
+ attr_keys = dict_keys(attr_list)
|
|
|
+ while (0 < read_nr_out(attr_keys)):
|
|
|
+ attr_key = set_pop(attr_keys)
|
|
|
+ if (element_eq(read_attribute(model, v_m, attr_key), read_root())):
|
|
|
+ output((((" " + cast_v2s(attr_key)) + " : ") + cast_v2s(attr_list[attr_key])) + " = (undefined)")
|
|
|
+ else:
|
|
|
+ output(((((" " + cast_v2s(attr_key)) + " : ") + cast_v2s(attr_list[attr_key])) + " = ") + cast_v2s(read_attribute(model, v_m, attr_key)))
|
|
|
+
|
|
|
elif (cmd == "list"):
|
|
|
Element keys_m
|
|
|
keys_m = dict_keys(model["model"])
|