Browse Source

Change behaviour of external model compilation

Yentl Van Tendeloo 8 years ago
parent
commit
7c16d5e733
3 changed files with 5 additions and 10 deletions
  1. 2 5
      bootstrap/compiler.alc
  2. 2 4
      bootstrap/modelling.alc
  3. 1 1
      interface/HUTN/includes/compiler.alh

+ 2 - 5
bootstrap/compiler.alc

@@ -8,7 +8,6 @@ Element function generic_compile(code : String, port : String):
 	
 	String response
 	response = comm_get(port)
-	log("Got response: " + response)
 	if (response == "OK"):
 		Integer count
 		Element lst
@@ -38,10 +37,9 @@ Element function compile_code(code : String):
 		return read_root()!
 
 	else:
-		log("Compiling: " + list_to_string(list))
 		return construct_function_list(list)!
 
-Element function compile_model(code : String, metamodel : Element):
+Element function compile_model(code : String, model : Element):
 	String port
 	port = comm_connect("compiler")
 	comm_set(port, "model")
@@ -53,5 +51,4 @@ Element function compile_model(code : String, metamodel : Element):
 		return read_root()!
 
 	else:
-		log("Compiling: " + list_to_string(list))
-		return construct_model_list(metamodel, list)!
+		return construct_model_list(model, list)!

+ 2 - 4
bootstrap/modelling.alc

@@ -549,7 +549,7 @@ Element function construct_model_raw(metamodel : Element):
 		list_append(lst, input())
 		i = i + 1
 	
-	return construct_model_list(metamodel, lst)!
+	return construct_model_list(instantiate_model(metamodel), lst)!
 
 Element function get_func_AL_model(al_model : Element):
 	Element initial_function
@@ -579,12 +579,10 @@ Element function trim_AL_constructors(list : Element):
 
 	return lst!
 
-Element function construct_model_list(metamodel : Element, list : Element):
+Element function construct_model_list(model : Element, list : Element):
 	String command
-	Element model
 
 	list = list_reverse(list)
-	model = instantiate_model(metamodel)
 
 	while (list_len(list) > 0):
 		command = list_pop_final(list)

+ 1 - 1
interface/HUTN/includes/compiler.alh

@@ -1,2 +1,2 @@
 Element function compile_code(code : String)
-Element function compile_model(code : String, metamodel : Element)
+Element function compile_model(code : String, model : Element)