1 (***********************************************************************)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
19 exception Not_core_XPath of path
20 (** Raised whenever the XPath query contains not implemented structures *)
23 let asta = Asta.empty in
24 let rec trans = function
26 | s :: tl -> trans_step s; trans tl
29 and trans_init () = (* add THE top state *)
30 let top_st = Asta.new_state () in
32 List.fold_left (fun acc x -> (`Left *+ x +| acc))
33 Formula.true_ (Asta.top_states asta)
35 Asta.add_tr asta (top_st, Asta.any_label, or_top)
37 and trans_last (ax,test,pred) = (* a selecting state is needed *)
40 and trans_step (ax,test,pred) =
47 | Absolute steps -> trans_init(); trans steps; asta
48 | AbsoluteDoS steps as x -> raise (Not_core_XPath x)
49 | Relative steps as x -> raise (Not_core_XPath x)