1e4d26dbf71d41e1e2e0e922359b9ddc8ed58169
[tatoo.git] / src / xPath.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
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   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15 module Ast :
16 sig
17   type path = single_path list
18   and single_path = Absolute of step list | Relative of step list
19   and step = axis * test * expr list
20   and axis = Self | Attribute | Child | Descendant | DescendantOrSelf | FollowingSibling
21              | Parent | Ancestor | AncestorOrSelf | PrecedingSibling | Preceding | Following
22
23   and test = QNameSet.t
24
25   and binop = Eq | Neq | Lt | Gt | Lte | Gte | Or | And | Add | Sub | Mult | Div | Mod
26   and unop =  Neg
27   and expr =
28     | Number of [ `Int of int | `Float of float ]
29     | String of string
30     | Fun_call of QName.t * expr list
31     | Path of path
32     | Binop of expr * binop * expr
33     | Unop of unop * expr
34   type t = path
35   val text : QNameSet.t
36   val node : QNameSet.t
37   val star : QNameSet.t
38   val print_binop : Format.formatter -> binop -> unit
39   val print_unop : Format.formatter -> unop -> unit
40   val print_path : Format.formatter -> path -> unit
41   val print_single_path : Format.formatter -> single_path -> unit
42   val print_step : Format.formatter -> step -> unit
43   val print_axis : Format.formatter -> axis -> unit
44   val print_test : Format.formatter -> test -> unit
45   val print_expr : Format.formatter -> expr -> unit
46   end