|
@@ -191,6 +191,22 @@ Void function instantiate_attribute(model : Element, element : String, attribute
|
|
|
|
|
|
return!
|
|
|
|
|
|
+Void function instantiate_attribute_ref(model : Element, element : String, attribute_name : String, ref : String):
|
|
|
+ // Instantiate an attribute of something that needs to be instantiated
|
|
|
+ // Actually a bit more difficult than all the rest, as we need to find the attribute to instantiate
|
|
|
+ String attr_type
|
|
|
+ String attr_name
|
|
|
+
|
|
|
+ attr_type = find_attribute_type(model, element, attribute_name)
|
|
|
+
|
|
|
+ if (attr_type == ""):
|
|
|
+ log("Could not find attribute " + cast_v2s(attribute_name))
|
|
|
+ return!
|
|
|
+
|
|
|
+ instantiate_link(model, attr_type, "", element, ref)
|
|
|
+
|
|
|
+ return!
|
|
|
+
|
|
|
Void function instantiate_attribute_code(model : Element, element : String, attribute_name : String, code : Element):
|
|
|
String ref
|
|
|
ref = add_AL(model, code)
|
|
@@ -458,6 +474,8 @@ Void function construct_model():
|
|
|
instantiate_node(global_models[input()], input(), input())
|
|
|
elif (command == "instantiate_attribute"):
|
|
|
instantiate_attribute(global_models[input()], input(), input(), input())
|
|
|
+ elif (command == "instantiate_attribute_ref"):
|
|
|
+ instantiate_attribute_ref(global_models[input()], input(), input(), input())
|
|
|
elif (command == "instantiate_link"):
|
|
|
instantiate_link(global_models[input()], input(), input(), input(), input())
|
|
|
elif (command == "define_inheritance"):
|
|
@@ -473,12 +491,16 @@ Void function construct_model():
|
|
|
String location
|
|
|
local_name = input()
|
|
|
location = input()
|
|
|
+ log("Exporting to location " + location)
|
|
|
+ log(" name: " + local_name)
|
|
|
+ log("Export element: " + cast_e2s(global_models[local_name]))
|
|
|
export_node(location, global_models[local_name])
|
|
|
elif (command == "import_node"):
|
|
|
Element m
|
|
|
- m = import_node(input())
|
|
|
+ command = input()
|
|
|
+ m = import_node(command)
|
|
|
if (element_eq(m, read_root())):
|
|
|
- log("Error: import not found")
|
|
|
+ log("Error: import not found for " + command)
|
|
|
else:
|
|
|
dict_add(global_models, input(), m)
|
|
|
else:
|