|
|
@@ -86,11 +86,11 @@ Boolean function node_match(transf_model : Element, transf_elem : Element, host_
|
|
|
//TODO semantic check
|
|
|
return True
|
|
|
|
|
|
-Element function new_SearchState(OldSearchState : Element, NewTransfElem: Element, NewHostElem : Element):
|
|
|
+Element function new_SearchState(OldSearchState : Element, TransfModel : Element, NewTransfElem: Element, HostModel : Element, NewHostElem : Element):
|
|
|
Element nss
|
|
|
|
|
|
//new MATCHES
|
|
|
- dict_add(nss, "matches", OldSearchState["matches"]) //hopefully works as a value reference
|
|
|
+ dict_add(nss, "matches", OldSearchState["matches"]) //hopefully works as a reference
|
|
|
|
|
|
//new CURMATCH
|
|
|
Element OldCurMatchKeys // for looping trough old curmatch (for copying)
|
|
|
@@ -106,9 +106,9 @@ Element function new_SearchState(OldSearchState : Element, NewTransfElem: Elemen
|
|
|
dict_add(newPair, "pn", newTransfElem) //PatternNode
|
|
|
dict_add(newPair, "hn", newHostElem) // HostNode
|
|
|
Integer plabel
|
|
|
- //TODO get plabel
|
|
|
- dict_add(new_curmatch, plabel, newPair-
|
|
|
- dict_add(nss, "curmatch", new_curmatch)
|
|
|
+ plabel = read_attribute(TransfModel, getName(TransfModel, NewTransfElem), "plabel")
|
|
|
+ dict_add(new_curmatch, plabel, newPair) //add pair to new curmatch
|
|
|
+ dict_add(nss, "curmatch", new_curmatch) //add curmatch to state
|
|
|
|
|
|
//new N_PATTERN_OUT (copy everything but the new match elements)
|
|
|
//TODO
|
|
|
@@ -171,6 +171,7 @@ Element function transf_vf2(SearchState: Element, transf_m : Element, host_m : E
|
|
|
pattern_list = SearchState["N_pattern_out"]
|
|
|
host_list = SearchState["N_host_out"]
|
|
|
index1 = 0
|
|
|
+ Element nss //variable for storing next searchstate
|
|
|
while ( index1 < list_len(pattern_list) ):
|
|
|
pattern_node = list_read(pattern_list, index1)
|
|
|
index1 = index1 + 1
|
|
|
@@ -179,6 +180,7 @@ Element function transf_vf2(SearchState: Element, transf_m : Element, host_m : E
|
|
|
host_node = list_read(host_list, index2)
|
|
|
index2= index2 + 1
|
|
|
if(node_match(transf_m, pattern_node, host_m, host_node)):
|
|
|
+ nss = new_SearchState(SearchState, transf_m, pattern_node, host_m, host_node)
|
|
|
//TODO recursive call (nodes added to new current match, reorder Nout Nin V)
|
|
|
//TODO repeat above loop for in
|
|
|
//TODO repeat above loop for V
|