Usable version:
[tatoo.git] / src / xPath.mli
diff --git a/src/xPath.mli b/src/xPath.mli
new file mode 100644 (file)
index 0000000..44935c3
--- /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.                                                        *)
+(*                                                                     *)
+(***********************************************************************)
+
+
+(** Abstract syntax tree of XPath queries *)
+
+module Ast :
+sig
+  type path = Absolute of step list | AbsoluteDoS of step list
+              | Relative of step list
+
+  and step = axis * test * predicate
+  and axis = Self | Attribute | Child | Descendant | DescendantOrSelf
+             | FollowingSibling
+             | Parent | Ancestor | AncestorOrSelf |PrecedingSibling
+             | Preceding | Following
+  and test =  Simple of QNameSet.t
+  and predicate = Or of predicate*predicate
+                  | And of predicate*predicate
+                  | Not of predicate
+                  | Expr of expression
+  and expression =  Path of path
+                    | Function of string*expression list
+                    | Int of int
+                    | String of string
+                    | True | False
+  type t = path
+  val print : Format.formatter -> path -> unit
+  val print_step : Format.formatter -> step -> unit
+  val print_axis : Format.formatter -> axis -> unit
+  val print_test : Format.formatter -> test -> unit
+  val print_predicate : Format.formatter -> predicate -> unit
+  val print_expression : Format.formatter -> expression -> unit
+end
+
+
+val parse : string -> Ast.path