Browse Source

Updated ActionLanguage -> ActionCode for ComplexAttribute

Yentl Van Tendeloo 5 years ago
parent
commit
a50565bcb4
2 changed files with 13 additions and 15 deletions
  1. 12 14
      bootstrap/ramify.alc
  2. 1 1
      bootstrap/utils.alc

+ 12 - 14
bootstrap/ramify.alc

@@ -31,20 +31,18 @@ Element function ramify(model : Element):
 	instantiate_node(new_model, "SimpleAttribute", "Location")
 	instantiate_attribute(new_model, "Location", "constraint", constraint_Location)
 
-	instantiate_node(new_model, "ComplexAttribute", "ActionLanguage")
-	instantiate_attribute(new_model, "ActionLanguage", "constraint", constraint_ActionLanguage)
-	model_define_attribute(new_model, "ActionLanguage", "type", False, "Location")
+	instantiate_node(new_model, "ActionLanguage", "ActionCode")
 
 	// Add some default elements
 	//	Class LHS_Root {
-	//		constraint? : ActionLanguage
+	//		constraint? : ActionCode
 	//		upper_cardinality = 1
 	//		lower_cardinality = 1
 	//	}
 	instantiate_node(new_model, "Class", "LHS_Root")
 	instantiate_attribute(new_model, "LHS_Root", "lower_cardinality", 1)
 	instantiate_attribute(new_model, "LHS_Root", "upper_cardinality", 1)
-	model_define_attribute(new_model, "LHS_Root", "constraint", True, "ActionLanguage")
+	model_define_attribute(new_model, "LHS_Root", "constraint", True, "ActionCode")
 
 	//  Class LHS : LHS_Root {}
 	instantiate_node(new_model, "Class", "LHS")
@@ -58,17 +56,17 @@ Element function ramify(model : Element):
 
 	//	Class PreElement {
 	//		label : String
-	//		constraint? : ActionLanguage
+	//		constraint? : ActionCode
 	//	}
 	instantiate_node(new_model, "Class", "PreElement")
 	model_define_attribute(new_model, "PreElement", "label", False, "String")
-	model_define_attribute(new_model, "PreElement", "constraint", True, "ActionLanguage")
+	model_define_attribute(new_model, "PreElement", "constraint", True, "ActionCode")
 
 	// Association LHS_contains (LHS_Root, PreElement) {}
 	instantiate_link(new_model, "Association", "LHS_contains", "LHS_Root", "PreElement")
 
 	//	Class RHS {
-	//		action? : ActionLanguage
+	//		action? : ActionCode
 	//		upper_cardinality = 1
 	//		lower_cardinality = 1
 	//	}
@@ -76,16 +74,16 @@ Element function ramify(model : Element):
 	instantiate_attribute(new_model, "RHS", "lower_cardinality", 1)
 	instantiate_attribute(new_model, "RHS", "upper_cardinality", 1)
 	instantiate_attribute(new_model, "RHS", "name", "RHS")
-	model_define_attribute(new_model, "RHS", "action", True, "ActionLanguage")
+	model_define_attribute(new_model, "RHS", "action", True, "ActionCode")
 
 	//	Class PostElement {
 	//		label : String
-	//		action? : ActionLanguage
+	//		action? : ActionCode
 	//	}
 	instantiate_node(new_model, "Class", "PostElement")
 	model_define_attribute(new_model, "PostElement", "label", False, "String")
-	model_define_attribute(new_model, "PostElement", "action", True, "ActionLanguage")
-	model_define_attribute(new_model, "PostElement", "__id__", True, "ActionLanguage")
+	model_define_attribute(new_model, "PostElement", "action", True, "ActionCode")
+	model_define_attribute(new_model, "PostElement", "__id__", True, "ActionCode")
 
 	// Association RHS_contains (RHS, PostElement) {}
 	instantiate_link(new_model, "Association", "RHS_contains", "RHS", "PostElement")
@@ -154,8 +152,8 @@ Element function ramify(model : Element):
 				if (is_nominal_instance(model, old_source, "Element")):
 					// If the attribute is one used in the conformance check, we should mask it
 					// Add the attribute in the new model, altering its name and making it optional
-					model_define_attribute(new_model, "Pre_" + old_source, "constraint_" + attr_name, True, "ActionLanguage")
-					model_define_attribute(new_model, "Post_" + old_source, "value_" + attr_name, True, "ActionLanguage")
+					model_define_attribute(new_model, "Pre_" + old_source, "constraint_" + attr_name, True, "ActionCode")
+					model_define_attribute(new_model, "Post_" + old_source, "value_" + attr_name, True, "ActionCode")
 			else:
 				// Queue for later
 				list_append(keys, key)

+ 1 - 1
bootstrap/utils.alc

@@ -50,7 +50,7 @@ String function JSON_print(model : Element):
 							result = result + ", \"" + attr_key + "\": false"
 					else:
 						type_attr = read_type(model, reverseKeyLookup(model["model"], attr_value))
-						if (read_type(model["metamodel"], type_attr) == "ComplexAttribute"):
+						if (read_type(model["metamodel"], type_attr) == "ActionLanguage"):
 							result = result + ", \"" + attr_key + "\": {\"AL\": " + cast_value(attr_value) + "}"
 						else:
 							result = result + ", \"" + attr_key + "\": " + cast_value(attr_value)