|
@@ -68,7 +68,7 @@ bottom = [
|
|
bottom_link_al = [
|
|
bottom_link_al = [
|
|
"model",
|
|
"model",
|
|
"instantiate_node", "1", "ComplexAttribute", "ActionLanguage",
|
|
"instantiate_node", "1", "ComplexAttribute", "ActionLanguage",
|
|
- "instantiate_attribute", "1", "ActionLanguage", "type", "models/ActionLanguage_new",
|
|
|
|
|
|
+ "instantiate_attribute", "1", "ActionLanguage", "type", "models/ActionLanguage",
|
|
|
|
|
|
"model_define_attribute", "1", "Element", "constraint", True, "ActionLanguage",
|
|
"model_define_attribute", "1", "Element", "constraint", True, "ActionLanguage",
|
|
"exit",
|
|
"exit",
|
|
@@ -180,7 +180,6 @@ action_language = [
|
|
"instantiate_link", "2", "Inheritance", "", "call_params", "dict_link",
|
|
"instantiate_link", "2", "Inheritance", "", "call_params", "dict_link",
|
|
"instantiate_link", "2", "Inheritance", "", "call_last_param", "dict_link",
|
|
"instantiate_link", "2", "Inheritance", "", "call_last_param", "dict_link",
|
|
|
|
|
|
- "instantiate_attribute", "2", "Statement_next", "target_lower_cardinality", 1,
|
|
|
|
"instantiate_attribute", "2", "if_else", "target_lower_cardinality", 1,
|
|
"instantiate_attribute", "2", "if_else", "target_lower_cardinality", 1,
|
|
"instantiate_attribute", "2", "return_value", "target_lower_cardinality", 1,
|
|
"instantiate_attribute", "2", "return_value", "target_lower_cardinality", 1,
|
|
"instantiate_attribute", "2", "param_next_param", "target_lower_cardinality", 1,
|
|
"instantiate_attribute", "2", "param_next_param", "target_lower_cardinality", 1,
|
|
@@ -192,15 +191,10 @@ action_language = [
|
|
]
|
|
]
|
|
|
|
|
|
def add_constraint(model, element, code):
|
|
def add_constraint(model, element, code):
|
|
- location = "constraints/%s_%s" % (model, element)
|
|
|
|
- print(locals())
|
|
|
|
- return [
|
|
|
|
- "model",
|
|
|
|
- "add_code_model", "2", location,
|
|
|
|
- ] + get_constructor(code) + [
|
|
|
|
- "instantiate_attribute", model, element, "constraint", location,
|
|
|
|
- "exit",
|
|
|
|
- ]
|
|
|
|
|
|
+ return ["model",
|
|
|
|
+ "instantiate_attribute_code", model, element, "constraint"] + \
|
|
|
|
+ get_constructor(code) + \
|
|
|
|
+ ["exit",]
|
|
|
|
|
|
instantiate_scd = [
|
|
instantiate_scd = [
|
|
"model",
|
|
"model",
|
|
@@ -392,7 +386,7 @@ class TestConstructorsModels(unittest.TestCase):
|
|
add_constraint("1", "String", code_string) + \
|
|
add_constraint("1", "String", code_string) + \
|
|
add_constraint("1", "Location", code_location) + \
|
|
add_constraint("1", "Location", code_location) + \
|
|
add_constraint("1", "Boolean", code_boolean) + \
|
|
add_constraint("1", "Boolean", code_boolean) + \
|
|
- add_constraint("1", "ActionLanguage_new", code_complex_attribute) + \
|
|
|
|
|
|
+ add_constraint("1", "ActionLanguage", code_complex_attribute) + \
|
|
conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
@@ -404,7 +398,7 @@ class TestConstructorsModels(unittest.TestCase):
|
|
add_constraint("1", "String", code_string) + \
|
|
add_constraint("1", "String", code_string) + \
|
|
add_constraint("1", "Location", code_location) + \
|
|
add_constraint("1", "Location", code_location) + \
|
|
add_constraint("1", "Boolean", code_boolean) + \
|
|
add_constraint("1", "Boolean", code_boolean) + \
|
|
- add_constraint("1", "ActionLanguage_new", code_complex_attribute) + \
|
|
|
|
|
|
+ add_constraint("1", "ActionLanguage", code_complex_attribute) + \
|
|
instantiate_scd + \
|
|
instantiate_scd + \
|
|
add_constraint("3", "Natural", code_natural) + \
|
|
add_constraint("3", "Natural", code_natural) + \
|
|
conformance_check("models/PetriNets_new") + \
|
|
conformance_check("models/PetriNets_new") + \
|