|
@@ -144,15 +144,12 @@ Element function get_possible_bindings(host_model : Element, schedule_model : El
|
|
|
// Check local constraints and add only if positive
|
|
|
Element constraint_function
|
|
|
Boolean result
|
|
|
- Element params
|
|
|
+ Element func
|
|
|
|
|
|
constraint_function = read_attribute(schedule_model, current_element, "constraint")
|
|
|
- params = create_node()
|
|
|
- dict_add(params, "model", host_model)
|
|
|
- dict_add(params, "option", option)
|
|
|
- log("Invoking constraint in match!")
|
|
|
- result = execute_AL_model(constraint_function, params)
|
|
|
- log("Result of constraint: " + cast_e2s(result))
|
|
|
+ func = get_func_AL_model(constraint_function)
|
|
|
+ result = func(host_model, option)
|
|
|
+
|
|
|
if (result):
|
|
|
set_add(filtered_options, option)
|
|
|
|
|
@@ -330,14 +327,9 @@ Void function rewrite(host_model : Element, schedule_model : Element, RHS : Stri
|
|
|
label = set_pop(original_RHS_labels)
|
|
|
action = read_attribute(schedule_model, RHS_map[label], "action")
|
|
|
if (element_neq(action, read_root())):
|
|
|
- Element params
|
|
|
- params = create_node()
|
|
|
- dict_add(params, "model", host_model)
|
|
|
- dict_add(params, "name", new_mapping[label])
|
|
|
- dict_add(params, "mapping", mapping)
|
|
|
- log("Execute RHS Action")
|
|
|
- execute_AL_model(action, params)
|
|
|
- log("Finished!")
|
|
|
+ Element func
|
|
|
+ func = get_func_AL_model(action)
|
|
|
+ func(host_model, new_mapping[label], mapping)
|
|
|
|
|
|
while (read_nr_out(labels_to_remove) > 0):
|
|
|
// Remove the elements linked to these labels
|
|
@@ -348,13 +340,9 @@ Void function rewrite(host_model : Element, schedule_model : Element, RHS : Stri
|
|
|
// Execute global action (whatever it may be)
|
|
|
action = read_attribute(schedule_model, RHS, "action")
|
|
|
if (element_neq(action, read_root())):
|
|
|
- Element params
|
|
|
- params = create_node()
|
|
|
- dict_add(params, "model", host_model)
|
|
|
- dict_add(params, "mapping", new_mapping)
|
|
|
- log("Execute global RHS Action")
|
|
|
- execute_AL_model(action, params)
|
|
|
- log("Finished!")
|
|
|
+ Element func
|
|
|
+ func = get_func_AL_model(action)
|
|
|
+ func(host_model, new_mapping)
|
|
|
|
|
|
return!
|
|
|
|