X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=xPath.ml;h=3fbfacf8718f6acfaed79dbba855a9b16add0f98;hb=22e128466565745a4e74f3b9823e7884ee5c6157;hp=27479be6b1925b0906576fcaa67c3b394755e1da;hpb=6131f2f9e380543197c9fa253325bbc84749e6e8;p=SXSI%2Fxpathcomp.git diff --git a/xPath.ml b/xPath.ml index 27479be..3fbfacf 100644 --- a/xPath.ml +++ b/xPath.ml @@ -328,8 +328,9 @@ let rec compile_step ?(existential=false) conf q_src dir ctx_path nrec step num in let new_st,new_dst, new_ctx = match axis with - | Child | Descendant -> + if (TagSet.is_finite test) + then conf.entry_points <- (TagSet.choose test,Ptset.singleton q_src)::conf.entry_points; let left,right = if nrec then `LLeft,`RRight else `Left,`Right @@ -549,12 +550,12 @@ let compile path = let s = Ptset.union anc_st (Ptset.from_list []) in if has_backward then Ptset.add config.st_from_root s else s in { Ata.id = Oo.id (object end); - Ata.states = if has_backward then Ptset.add config.st_from_root a_st else a_st; + Ata.states = Hashtbl.fold (fun q _ acc -> Ptset.add q acc) phi Ptset.empty; Ata.init = Ptset.singleton config.st_root; Ata.final = Ptset.union anc_st config.final_state; Ata.universal = Ptset.add a_dst (Ptset.from_list config.univ_states); Ata.phi = phi; - Ata.sigma = Ata.HTagSet.create 17; + Ata.sigma = Hashtbl.create 17; Ata.starstate = config.starstate; },config.entry_points,!contains