First implementation of compilation from XPath to automata using
[tatoo.git] / src / xpath / ast.ml
index 39777eb..d70227b 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-02-14 16:45:52 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-04 16:24:20 CET by Kim Nguyen>
 *)
 
 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
+;;
+