Add the compilation from existential XPath to automata.
[tatoo.git] / src / xpath / ast.ml
index c3c00d9..39777eb 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-02-07 10:04:30 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-02-14 16:45:52 CET by Kim Nguyen>
 *)
 
 open Utils
@@ -22,8 +22,13 @@ open Utils
 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 axis = Self | Attribute | Child
+           | Descendant of bool  (* true = descendant-or-self, false = descendant *)
+           | FollowingSibling
+           | Parent
+           | Ancestor of bool (* true = ancestor-or-self, false = ancestor *)
+           | PrecedingSibling
+           | Preceding | Following
 
 and test = QNameSet.t
 
@@ -111,12 +116,12 @@ and print_axis fmt a = pp fmt "%s" begin
   match a with
     Self -> "self"
   | Child -> "child"
-  | Descendant -> "descendant"
-  | DescendantOrSelf -> "descendant-or-self"
+  | Descendant false -> "descendant"
+  | Descendant true -> "descendant-or-self"
   | FollowingSibling -> "following-sibling"
   | Attribute -> "attribute"
-  | Ancestor -> "ancestor"
-  | AncestorOrSelf -> "ancestor-or-self"
+  | Ancestor false -> "ancestor"
+  | Ancestor true -> "ancestor-or-self"
   | PrecedingSibling -> "preceding-sibling"
   | Parent -> "parent"
   | Preceding -> "preceding"