(* *)
(***********************************************************************)
-(*
- Time-stamp: <Last modified on 2013-02-05 14:53:12 CET by Kim Nguyen>
-*)
-
open Xpath_internal_parser
module L = Ulexing
let return_loc i j tok = (tok, (i,j))
let regexp ncname_char =
- xml_letter | xml_digit | [ '-' '_' ] | xml_combining_char | xml_extender | "\\."
+ xml_letter | xml_digit | [ '-' '_' '.'] | xml_combining_char | xml_extender
let hexa_digit = function
| '0'..'9' as c -> (Char.code c) - (Char.code '0')
try
List.assoc s [
"self", AXIS Ast.Self;
- "descendant", AXIS Ast.Descendant;
+ "descendant", AXIS (Ast.Descendant false);
"child", AXIS Ast.Child;
- "descendant-or-self", AXIS Ast.DescendantOrSelf;
+ "descendant-or-self", AXIS (Ast.Descendant true);
"attribute", AXIS Ast.Attribute;
"following-sibling", AXIS Ast.FollowingSibling;
"preceding-sibling", AXIS Ast.PrecedingSibling;
"parent", AXIS Ast.Parent;
- "ancestor", AXIS Ast.Ancestor;
- "ancestor-or-self", AXIS Ast.AncestorOrSelf;
+ "ancestor", AXIS (Ast.Ancestor false);
+ "ancestor-or-self", AXIS (Ast.Ancestor true);
"preceding", AXIS Ast.Preceding;
"following", AXIS Ast.Following;
"and", AND;
| ">=" -> GTE
| "=" -> EQ
| "!=" -> NEQ
+ | ".." -> DOTDOT
+ | "." -> DOT
| "node()" -> NODE
| "text()" -> TEXT
+ | "comment()" -> COMMENT
+ | '@' ncname -> ATTNAME (L.utf8_lexeme lexbuf)
+ | "processing-instruction()" -> PI ""
+ | "processing-instruction('"ncname"')"
+ | "processing-instruction(\""ncname"\")"->
+ let s = L.utf8_lexeme lexbuf in
+ PI (String.sub s 24 (String.length s - 26))
| ncname -> keyword_or_tag (L.utf8_lexeme lexbuf)
| float ->
let s = L.utf8_lexeme lexbuf in
| _ ->
store_lexeme lexbuf;
string start double lexbuf
-
-