|
@@ -83,11 +83,6 @@ action_language = [
|
|
|
"instantiate_node", "1", "AttributeValue", "resolve",
|
|
|
"instantiate_node", "1", "AttributeValue", "call",
|
|
|
|
|
|
- "instantiate_link", "1", "Attribute", "dict_link", "Action", "PrimitiveType",
|
|
|
- "instantiate_attribute", "1", "dict_link", "name", "dictionary_link",
|
|
|
- "instantiate_attribute", "1", "dict_link", "optional", True,
|
|
|
- "model_define_attribute", "1", "dict_link", "name", False, "String",
|
|
|
-
|
|
|
"instantiate_link", "1", "Inheritance", "", "Action", "Element",
|
|
|
"instantiate_link", "1", "Inheritance", "", "funcdef", "Action",
|
|
|
"instantiate_link", "1", "Inheritance", "", "param", "Action",
|
|
@@ -110,8 +105,8 @@ action_language = [
|
|
|
|
|
|
"model_define_attribute", "1", "Statement", "next", True, "Statement",
|
|
|
"model_define_attribute", "1", "if", "cond", False, "Expression",
|
|
|
- "model_define_attribute", "1", "if", "true", False, "Statement",
|
|
|
- "model_define_attribute", "1", "if", "false", True, "Statement",
|
|
|
+ "model_define_attribute", "1", "if", "then", False, "Statement",
|
|
|
+ "model_define_attribute", "1", "if", "else", True, "Statement",
|
|
|
"model_define_attribute", "1", "while", "cond", False, "Expression",
|
|
|
"model_define_attribute", "1", "while", "body", False, "Statement",
|
|
|
"model_define_attribute", "1", "assign", "var", False, "resolve",
|
|
@@ -119,7 +114,7 @@ action_language = [
|
|
|
"model_define_attribute", "1", "break", "while", False, "while",
|
|
|
"model_define_attribute", "1", "continue", "while", False, "while",
|
|
|
"model_define_attribute", "1", "return", "value", True, "Expression",
|
|
|
- "model_define_attribute", "1", "resolve", "var", False, "String",
|
|
|
+ "model_define_attribute", "1", "resolve", "var", False, "PrimitiveType",
|
|
|
"model_define_attribute", "1", "access", "var", False, "resolve",
|
|
|
"model_define_attribute", "1", "constant", "node", False, "PrimitiveType",
|
|
|
"model_define_attribute", "1", "output", "node", False, "Expression",
|
|
@@ -132,36 +127,33 @@ action_language = [
|
|
|
"model_define_attribute", "1", "call", "params", True, "param",
|
|
|
"model_define_attribute", "1", "call", "last_param", True, "param",
|
|
|
|
|
|
- "instantiate_link", "1", "Inheritance", "", "Statement_next", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "if_cond", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "if_true", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "if_false", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "while_cond", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "while_body", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "assign_var", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "assign_value", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "break_while", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "continue_while", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "return_value", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "resolve_var", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "access_var", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "constant_node", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "output_node", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "global_var", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "param_name", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "param_value", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "param_next_param", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "funcdef_body", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "call_func", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "call_params", "dict_link",
|
|
|
- "instantiate_link", "1", "Inheritance", "", "call_last_param", "dict_link",
|
|
|
+ # TODO these Strings are actually supposed to be more restricted!
|
|
|
+ "model_define_attribute", "1", "Statement_next", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "if_cond", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "if_then", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "if_else", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "while_cond", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "while_body", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "assign_var", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "assign_value", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "break_while", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "continue_while", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "return_value", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "resolve_var", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "access_var", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "constant_node", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "output_node", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "global_var", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "param_name", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "param_value", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "param_next_param", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "funcdef_body", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "call_func", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "call_params", "name", False, "String",
|
|
|
+ "model_define_attribute", "1", "call_last_param", "name", False, "String",
|
|
|
|
|
|
- "model_define_attribute", "1", "Class", "constraint", True, "funcdef",
|
|
|
- "exit",
|
|
|
- ]
|
|
|
-
|
|
|
-bottom_attributes = [
|
|
|
- "model",
|
|
|
+ "model_define_attribute", "1", "Element", "constraint", True, "funcdef",
|
|
|
+ "model_define_attribute", "1", "AttributeValue", "to_string", True, "funcdef",
|
|
|
"exit",
|
|
|
]
|
|
|
|
|
@@ -311,42 +303,42 @@ def conformance_check(node):
|
|
|
|
|
|
class TestConstructorsModels(unittest.TestCase):
|
|
|
def test_constructors_instantiate_bottom(self):
|
|
|
- commands = bottom + bottom_attributes + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
+ commands = bottom + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
def test_constructors_action_language(self):
|
|
|
- commands = bottom + action_language + bottom_attributes + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
+ commands = bottom + action_language + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
- def test_constructors_constraints(self):
|
|
|
- commands = bottom + action_language + bottom_attributes + add_constraints(1) + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
+ def test_constructors_constraints_scd(self):
|
|
|
+ commands = bottom + action_language + add_constraints(1) + conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
- def test_constructors_constraints_executed(self):
|
|
|
- commands = bottom + action_language + bottom_attributes + add_constraints(1) + instantiate_scd + add_constraints(2) + instantiate_pn + conformance_check("models/PN_instance") + ["return", False]
|
|
|
+ def test_constructors_constraints_pn(self):
|
|
|
+ commands = bottom + action_language + add_constraints(1) + instantiate_scd + add_constraints(2) + instantiate_pn + conformance_check("models/PN_instance") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
def test_constructors_instantiate_scd(self):
|
|
|
- commands = bottom + bottom_attributes + instantiate_scd + conformance_check("models/PetriNets_new") + ["return", False]
|
|
|
+ commands = bottom + instantiate_scd + conformance_check("models/PetriNets_new") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
def test_constructors_instantiate_pn(self):
|
|
|
- commands = bottom + bottom_attributes + instantiate_scd + instantiate_pn + conformance_check("models/PN_instance") + ["return", False]
|
|
|
+ commands = bottom + instantiate_scd + instantiate_pn + conformance_check("models/PN_instance") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK"], 1))
|
|
|
|
|
|
def test_constructors_instantiate_example(self):
|
|
|
- commands = bottom + bottom_attributes + instantiate_example + conformance_check("models/example_MM") + conformance_check("models/example_M") + ["return", False]
|
|
|
+ commands = bottom + instantiate_example + conformance_check("models/example_MM") + conformance_check("models/example_M") + ["return", False]
|
|
|
self.assertTrue(run_barebone(commands, ["OK", "OK"], 1))
|
|
|
|
|
|
def test_constructors_is_direct_instance(self):
|
|
|
- commands = bottom + bottom_attributes + instantiate_example + is_direct_instance + ["return", False]
|
|
|
+ commands = bottom + instantiate_example + is_direct_instance + ["return", False]
|
|
|
expected = [True, False, False,
|
|
|
False, True, False,
|
|
|
False, False, True]
|
|
|
self.assertTrue(run_barebone(commands, expected, 1))
|
|
|
|
|
|
def test_constructors_is_nominal_instance(self):
|
|
|
- commands = bottom + bottom_attributes + instantiate_example + is_nominal_instance + ["return", False]
|
|
|
+ commands = bottom + instantiate_example + is_nominal_instance + ["return", False]
|
|
|
expected = [True, True, False,
|
|
|
False, True, False,
|
|
|
False, False, True]
|