X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FxPath.mli;h=e80a88a93e7b70fdf2d7e55b047ffe3a12965b37;hb=c951f1d4b8f4264acb0b5910dc544ad3a6ceebab;hp=de899555031f68e46357660b70af82fe513c4af4;hpb=d2f5764e9f0e89f485d6237d07cbe9b04b7426ae;p=tatoo.git diff --git a/src/xPath.mli b/src/xPath.mli index de89955..e80a88a 100644 --- a/src/xPath.mli +++ b/src/xPath.mli @@ -18,32 +18,24 @@ module Ast : sig - type path = Absolute 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 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 + and test = Simple of QNameSet.t + + 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 -val parse_string : string -> Ast.path -val parse_file : in_channel -> Ast.path + type t = path +end