|
@@ -108,6 +108,9 @@ String function instantiate_node(model : Element, type_name : String, instance_n
|
|
log(" for " + instance_name)
|
|
log(" for " + instance_name)
|
|
return ""!
|
|
return ""!
|
|
|
|
|
|
|
|
+ if (dict_in(model["model"], instance_name)):
|
|
|
|
+ return ""!
|
|
|
|
+
|
|
actual_name = model_add_node(model, instance_name)
|
|
actual_name = model_add_node(model, instance_name)
|
|
retype(model, actual_name, type_name)
|
|
retype(model, actual_name, type_name)
|
|
|
|
|
|
@@ -123,6 +126,9 @@ String function instantiate_value(model : Element, type_name : String, instance_
|
|
log(" for " + instance_name)
|
|
log(" for " + instance_name)
|
|
return ""!
|
|
return ""!
|
|
|
|
|
|
|
|
+ if (dict_in(model["model"], instance_name)):
|
|
|
|
+ return ""!
|
|
|
|
+
|
|
actual_name = model_add_value(model, instance_name, value)
|
|
actual_name = model_add_value(model, instance_name, value)
|
|
retype(model, actual_name, type_name)
|
|
retype(model, actual_name, type_name)
|
|
|
|
|
|
@@ -207,6 +213,9 @@ Void function instantiate_attribute(model : Element, element : String, attribute
|
|
String attr_type
|
|
String attr_type
|
|
String attr_name
|
|
String attr_name
|
|
|
|
|
|
|
|
+ if (element_neq(read_attribute(model, element, attribute_name), read_root())):
|
|
|
|
+ unset_attribute(model, element, attribute_name)
|
|
|
|
+
|
|
attr_type = find_attribute_type(model, element, attribute_name)
|
|
attr_type = find_attribute_type(model, element, attribute_name)
|
|
|
|
|
|
if (attr_type == ""):
|
|
if (attr_type == ""):
|
|
@@ -268,6 +277,9 @@ String function instantiate_link(model : Element, type : String, name : String,
|
|
// Create a typed link between two nodes
|
|
// Create a typed link between two nodes
|
|
String actual_name
|
|
String actual_name
|
|
|
|
|
|
|
|
+ if (dict_in(model["model"], name)):
|
|
|
|
+ return ""!
|
|
|
|
+
|
|
if (type == ""):
|
|
if (type == ""):
|
|
// Have to find the type ourselves, as it isn't defined
|
|
// Have to find the type ourselves, as it isn't defined
|
|
Element out
|
|
Element out
|
|
@@ -557,6 +569,7 @@ Element function construct_model_raw(metamodel : Element):
|
|
|
|
|
|
while (True):
|
|
while (True):
|
|
command = input()
|
|
command = input()
|
|
|
|
+ log("EXEC " + command)
|
|
if (command == "add_node"):
|
|
if (command == "add_node"):
|
|
input()
|
|
input()
|
|
model_add_node(model, input())
|
|
model_add_node(model, input())
|