Browse Source

Working AL to PY again, but now with correct variable names

Yentl Van Tendeloo 7 years ago
parent
commit
b5959a2a33
4 changed files with 6 additions and 5 deletions
  1. BIN
      bootstrap/bootstrap.m.gz
  2. 1 2
      bootstrap/constructors.alc
  3. 4 2
      models/AL_to_py.alc
  4. 1 1
      wrappers/modelverse_SCCD.py

BIN
bootstrap/bootstrap.m.gz


+ 1 - 2
bootstrap/constructors.alc

@@ -95,7 +95,7 @@ String function construct_global(model : Element, list : Element):
 
 	this_element = instantiate_value(model, "global", "", create_value(!global))
 	declared_element = instantiate_value(model, "String", "", create_value(list_pop_final(list)))
-	create_al_link(model, "global_var", this_element, instantiate_value(model, "String", "", declared_element), "var")
+	create_al_link(model, "global_var", this_element, declared_element, "var")
 
 	op = list_pop_final(list)
 	if (op != "none"):
@@ -160,7 +160,6 @@ String function construct_funcdef(model : Element, list : Element, mutable : Boo
 		formal = dict_read(variable_map, name)
 	else:
 		formal = instantiate_value(model, "String", "", name)
-	formal = instantiate_value(model, "String", "", formal)
 	func = instantiate_node(model, "funcdef", "")
 	params = instantiate_node(model, "param_dict", "")
 	create_al_link(model, "global_var", declare, formal, "var")

+ 4 - 2
models/AL_to_py.alc

@@ -167,13 +167,15 @@ String function code_print(node : Element, indentation : Integer):
 
 		Element param
 		param = node["params"]
-		while (True):
+		Boolean continue
+		continue = True
+		while (continue):
 			if (params == ""):
 				params = code_print(param["value"], 0)
 			else:
 				params = params + ", " + code_print(param["value"], 0)
 			if (bool_not(dict_in(param, "next_param"))):
-				break!
+				continue = False
 			param = param["next_param"]
 
 		code = func_name + "(" + params + ")"

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Wed Apr  4 10:50:09 2018
+Date:   Wed Apr  4 11:08:25 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server