Browse Source

Fixed functions: getName was missing --> PN and SCD work and are conform

Yentl Van Tendeloo 9 years ago
parent
commit
86765b2f0e
1 changed files with 2 additions and 7 deletions
  1. 2 7
      bootstrap/modelling.alc

+ 2 - 7
bootstrap/modelling.alc

@@ -101,7 +101,7 @@ Element function find_attribute_type(model : Element, elem : String, name : Stri
 		log("Undefined attribute!")
 		return read_root()
 	else:
-		return dict_read_edge(mm_elem, name)
+		return getName(model["metamodel"], dict_read_edge(mm_elem, name))
 
 Element function get_superclasses(model : Element, elem : Element):
 	Element result
@@ -113,7 +113,6 @@ Element function get_superclasses(model : Element, elem : Element):
 	result = create_node()
 	i = 0
 
-	log(cast_e2s(elem))
 	// Read out all outgoing edges
 	num_edges = read_nr_out(elem)
 	while (i < num_edges):
@@ -126,7 +125,6 @@ Element function get_superclasses(model : Element, elem : Element):
 Element function find_attribute_definer(model : Element, elem : Element, name : String):
 	if (dict_in(elem, name)):
 		// Try in the current class definition
-		log("Found attribute " + name)
 		return elem
 	else:
 		// Not found, so go to all superclasses and try there
@@ -134,13 +132,10 @@ Element function find_attribute_definer(model : Element, elem : Element, name :
 		Element current
 		Element found
 
-		log("Recurse attribute " + name)
-
 		superclasses = get_superclasses(model, elem)
 		while (list_len(superclasses) > 0):
 			current = set_pop(superclasses)
 			found = find_attribute_definer(model, current, name)
-			log("In superclass for " + name)
 			if (bool_not(element_eq(found, read_root()))):
 				// Found something!
 				return current
@@ -174,7 +169,7 @@ Void function instantiate_named(model : Element, type : String, name : String, s
 
 	link_name = instantiate_link(model, type, "", source, destination)
 	name_name = model_add_value(model, "", name)
-	retype(model, name_name, model["metamodel"]["model"]["String"])
+	retype(model, name_name, "String")
 	instantiate_attribute(model, link_name, "name", name_name)
 
 	return