X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fxpath%2Fast.ml;h=d70227bed900fd4421bf2892570e489200109685;hb=736f1c5caccbf659359853b9b0ad426f694c10ae;hp=39777eb9c51c5ddc34af715938e4fbd8d49f30bb;hpb=e13f5deae217f945b44fa345ef4f0008e1780787;p=tatoo.git diff --git a/src/xpath/ast.ml b/src/xpath/ast.ml index 39777eb..d70227b 100644 --- a/src/xpath/ast.ml +++ b/src/xpath/ast.ml @@ -14,7 +14,7 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) open Utils @@ -168,3 +168,17 @@ and print_expr fmt = function print_expr fmt e0; if need_par0 then pp fmt ")" + + +let invert_axis = function +| Self | Attribute as a -> a +| Child -> Parent +| Descendant (b) -> Ancestor (b) +| FollowingSibling -> PrecedingSibling +| Parent -> Child +| Ancestor (b) -> Descendant (b) +| PrecedingSibling -> FollowingSibling +| Preceding -> Following +| Following -> Preceding +;; +