|
@@ -46,7 +46,7 @@ Element function construct_function_list(list : Element):
|
|
|
|
|
|
|
|
continue = list_pop_final(list)
|
|
continue = list_pop_final(list)
|
|
|
if (element_neq(prev_element, read_root())):
|
|
if (element_neq(prev_element, read_root())):
|
|
|
- dict_add_fast(prev_element, "next", result["start"])
|
|
|
|
|
|
|
+ create_al_link(model, "Statement_next", prev_element, result["start"], "next")
|
|
|
else:
|
|
else:
|
|
|
first_element = result["start"]
|
|
first_element = result["start"]
|
|
|
|
|
|
|
@@ -67,16 +67,19 @@ Element function construct_function_list(list : Element):
|
|
|
return read_root()!
|
|
return read_root()!
|
|
|
|
|
|
|
|
// Overwrite the main function with our declaration function
|
|
// Overwrite the main function with our declaration function
|
|
|
|
|
+ log("Initial operation: " + reverseKeyLookup(model["model"], model["model"][main_function]["body"]))
|
|
|
prev_element = set_pop(allAssociationDestinations(model, main_function, "funcdef_body"))
|
|
prev_element = set_pop(allAssociationDestinations(model, main_function, "funcdef_body"))
|
|
|
- log("Got main function: " + main_function)
|
|
|
|
|
- log("Got main function: " + set_to_string(dict_keys(model["model"][main_function])))
|
|
|
|
|
- log("Parameters stored in " + cast_string(reverseKeyLookup(model["model"], model["model"][main_function]["params"])))
|
|
|
|
|
- log("Got parameters for main function: " + set_to_string(dict_keys(model["model"][main_function]["params"])))
|
|
|
|
|
|
|
+ log("Prev element: " + cast_string(prev_element))
|
|
|
|
|
+ log("First element: " + cast_string(first_element))
|
|
|
|
|
+ log("Function: " + cast_string(main_function))
|
|
|
model_delete_element(model, set_pop(allOutgoingAssociationInstances(model, main_function, "funcdef_body")))
|
|
model_delete_element(model, set_pop(allOutgoingAssociationInstances(model, main_function, "funcdef_body")))
|
|
|
create_al_link(model, "funcdef_body", main_function, first_element, "body")
|
|
create_al_link(model, "funcdef_body", main_function, first_element, "body")
|
|
|
create_al_link(model, "Statement_next", result["end"], prev_element, "next")
|
|
create_al_link(model, "Statement_next", result["end"], prev_element, "next")
|
|
|
|
|
+ log("Result end: " + cast_value(result["end"]))
|
|
|
instantiate_link(model, "initial_funcdef", "", instantiate_node(model, "Initial", ""), main_function)
|
|
instantiate_link(model, "initial_funcdef", "", instantiate_node(model, "Initial", ""), main_function)
|
|
|
log("Got body of main: " + cast_value(model["model"][main_function]["body"]))
|
|
log("Got body of main: " + cast_value(model["model"][main_function]["body"]))
|
|
|
|
|
+ log(" ID of main: " + cast_id(model["model"][main_function]["body"]))
|
|
|
|
|
+ log("internal ID of main: " + cast_string(reverseKeyLookup(model["model"], model["model"][main_function]["body"])))
|
|
|
|
|
|
|
|
log("Created model!")
|
|
log("Created model!")
|
|
|
return model!
|
|
return model!
|
|
@@ -376,7 +379,6 @@ String function construct_declare(model : Element, list : Element):
|
|
|
acc = instantiate_value(model, "access", "", create_value(!access))
|
|
acc = instantiate_value(model, "access", "", create_value(!access))
|
|
|
create_al_link(model, "call_func", value, acc, "func")
|
|
create_al_link(model, "call_func", value, acc, "func")
|
|
|
create_al_link(model, "access_var", acc, res, "var")
|
|
create_al_link(model, "access_var", acc, res, "var")
|
|
|
- dict_add_fast(res, "var", "create_node")
|
|
|
|
|
create_al_link(model, "resolve_var", res, instantiate_value(model, "String", "", "create_node"), "var")
|
|
create_al_link(model, "resolve_var", res, instantiate_value(model, "String", "", "create_node"), "var")
|
|
|
elif (op == "const"):
|
|
elif (op == "const"):
|
|
|
value = instantiate_value(model, "constant", "", create_value(!constant))
|
|
value = instantiate_value(model, "constant", "", create_value(!constant))
|