X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2FxPath.mli;h=76a6ab3642d750b1d10ec090762f3707cece5095;hb=73755ec720254766e4504ac72684be5e357b6939;hp=afb4c39e8bf5bfb895bf981bd00e5ee9e3ebef08;hpb=e2dce9a8858c17d907ddecc34cd939905a73f0cc;p=tatoo.git diff --git a/src/xPath.mli b/src/xPath.mli index afb4c39..76a6ab3 100644 --- a/src/xPath.mli +++ b/src/xPath.mli @@ -5,7 +5,7 @@ (* Kim Nguyen, LRI UMR8623 *) (* Université Paris-Sud & CNRS *) (* *) -(* Copyright 2010-2012 Université Paris-Sud and Centre National de la *) +(* Copyright 2010-2013 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 *) @@ -13,38 +13,41 @@ (* *) (***********************************************************************) +(* + Time-stamp: +*) + -(** Abstract syntax tree of XPath queries *) module Ast : sig - type path = Absolute of step list | AbsoluteDoS of step list - | Relative of step list + type path = single_path list + and single_path = Absolute of step list | Relative of step list + and step = axis * test * expr list + and axis = Self | Attribute | Child | Descendant | DescendantOrSelf | FollowingSibling + | Parent | Ancestor | AncestorOrSelf | PrecedingSibling | Preceding | Following + + and test = QNameSet.t - 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 + and binop = Eq | Neq | Lt | Gt | Lte | Gte | Or | And | Add | Sub | Mult | Div | Mod + and unop = Neg + and expr = + | Number of [ `Int of int | `Float of float ] + | String of string + | Fun_call of QName.t * expr list + | Path of path + | Binop of expr * binop * expr + | Unop of unop * expr type t = path - val print : Format.formatter -> path -> unit + val text : QNameSet.t + val node : QNameSet.t + val star : QNameSet.t + val print_binop : Format.formatter -> binop -> unit + val print_unop : Format.formatter -> unop -> unit + val print_path : Format.formatter -> path -> unit + val print_single_path : Format.formatter -> single_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 : string -> Ast.path -val parse_file : in_channel -> Ast.path + val print_expr : Format.formatter -> expr -> unit + end