Flatten the sources, only leave the XPath module packed.
[tatoo.git] / src / qNameSet.ml
diff --git a/src/qNameSet.ml b/src/qNameSet.ml
new file mode 100644 (file)
index 0000000..d895ff3
--- /dev/null
@@ -0,0 +1,49 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                               TAToo                                 *)
+(*                                                                     *)
+(*                     Kim Nguyen, LRI UMR8623                         *)
+(*                   Université Paris-Sud & CNRS                       *)
+(*                                                                     *)
+(*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
+(*  Recherche Scientifique. All rights reserved.  This file is         *)
+(*  distributed under the terms of the GNU Lesser General Public       *)
+(*  License, with the special exception on linking described in file   *)
+(*  ../LICENSE.                                                        *)
+(*                                                                     *)
+(***********************************************************************)
+
+(*
+  Time-stamp: <Last modified on 2013-03-09 17:54:35 CET by Kim Nguyen>
+*)
+
+include FiniteCofinite.Make(Ptset.Make(QName))
+
+let print_finite fmt e conv =
+  Format.fprintf fmt "{";
+  Pretty.print_list ~sep:"," QName.print fmt (conv e);
+  Format.fprintf fmt "}"
+
+let printer fmt e test conv inv is_any =
+  if test e then print_finite fmt e conv
+  else
+    let () = Format.fprintf fmt "%s" Pretty.big_sigma in
+    if not (is_any e) then begin Format.fprintf fmt "-";print_finite fmt (inv e) conv end
+
+let print fmt e = printer fmt e is_finite elements complement is_any
+
+let specials = [ QName.document; QName.text; QName.text ]
+let notstar = from_list specials
+let star = diff any notstar
+let node = any
+let text = singleton QName.text
+
+module Weak =
+struct
+  include FiniteCofinite.Weak(Ptset.Weak(QName))
+  let print fmt e =  printer fmt e is_finite elements complement is_any
+  let notstar = from_list specials
+  let star = diff any notstar
+  let node = any
+  let text = singleton QName.text
+end