projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add an INSTALL file.
[tatoo.git]
/
src
/
xpath
/
xpath_internal_parser.mly
diff --git
a/src/xpath/xpath_internal_parser.mly
b/src/xpath/xpath_internal_parser.mly
index
a40eea9
..
2a861aa
100644
(file)
--- a/
src/xpath/xpath_internal_parser.mly
+++ b/
src/xpath/xpath_internal_parser.mly
@@
-15,11
+15,11
@@
(***********************************************************************)
(*
(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-0
3-13 12:38:54 CE
T by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-0
4-04 18:44:13 CES
T by Kim Nguyen>
*)
open Ast
*)
open Ast
- open Tree
.Common
+ open Tree
%}
%token <string> TAG
%}
%token <string> TAG
@@
-30,7
+30,7
@@
%token <float> FLOAT
%token <Ast.axis> AXIS
%token RB LB LP RP
%token <float> FLOAT
%token <Ast.axis> AXIS
%token RB LB LP RP
-%token SLASH SLASHSLASH COLONCOLON STAR PIPE
+%token SLASH SLASHSLASH COLONCOLON STAR PIPE
DOT DOTDOT
%token EQ NEQ LT GT LTE GTE OR AND ADD SUB DIV MOD
%token NODE TEXT COMMENT
%token COMMA
%token EQ NEQ LT GT LTE GTE OR AND ADD SUB DIV MOD
%token NODE TEXT COMMENT
%token COMMA
@@
-91,7
+91,9
@@
relative_path:
;
step:
;
step:
- axis_test pred_list {
+ DOT { [ (Self, (node, NodeKind.Node), []) ] }
+| DOTDOT { [ (Parent, (node, NodeKind.Node), []) ] }
+| axis_test pred_list {
match $1 with
(a,b) :: r -> (a,b,$2) :: (List.map (fun (a,b) -> (a,b,[])) r)
| [] -> assert false
match $1 with
(a,b) :: r -> (a,b,$2) :: (List.map (fun (a,b) -> (a,b,[])) r)
| [] -> assert false
@@
-101,12
+103,12
@@
step:
axis_test:
AXIS COLONCOLON test { let a, (t,k) = $1, $3 in
match a with
axis_test:
AXIS COLONCOLON test { let a, (t,k) = $1, $3 in
match a with
- Attribute when
Utils.
QNameSet.is_finite t ->
- [ a, ((
Utils.
QNameSet.fold
+ Attribute when QNameSet.is_finite t ->
+ [ a, ((QNameSet.fold
(fun t a ->
(fun t a ->
-
Utils.
QNameSet.add
- (
Utils.
QName.attribute t) a)
- t
Utils.
QNameSet.empty), k) ]
+ QNameSet.add
+ (QName.attribute t) a)
+ t QNameSet.empty), k) ]
| Preceding|Following ->
[ (Descendant true, (t,k));
if a == Preceding then
| Preceding|Following ->
[ (Descendant true, (t,k));
if a == Preceding then
@@
-122,10
+124,10
@@
axis_test:
let _ = Format.flush_str_formatter () in
let () = Format.fprintf Format.str_formatter "%a" Ast.print_axis $1 in
let a = Format.flush_str_formatter () in
let _ = Format.flush_str_formatter () in
let () = Format.fprintf Format.str_formatter "%a" Ast.print_axis $1 in
let a = Format.flush_str_formatter () in
- [Child, (
Utils.QNameSet.singleton (Utils.
QName.of_string a),NodeKind.Element)]
+ [Child, (
QNameSet.singleton (
QName.of_string a),NodeKind.Element)]
}
| ATTNAME { [(Attribute,
}
| ATTNAME { [(Attribute,
- (
Utils.QNameSet.singleton (Utils.
QName.of_string $1),
+ (
QNameSet.singleton (
QName.of_string $1),
NodeKind.Attribute))] }
;
NodeKind.Attribute))] }
;
@@
-133,16
+135,16
@@
test:
NODE { node, NodeKind.Node }
| TEXT { text, NodeKind.Text }
| STAR { star, NodeKind.Element }
NODE { node, NodeKind.Node }
| TEXT { text, NodeKind.Text }
| STAR { star, NodeKind.Element }
-| COMMENT {
Utils.QNameSet.singleton(Utils.
QName.comment),
+| COMMENT {
QNameSet.singleton(
QName.comment),
NodeKind.Comment
}
| PI { (if $1 = "" then star
NodeKind.Comment
}
| PI { (if $1 = "" then star
- else
Utils.
QNameSet.singleton(
-
Utils.
QName.processing_instruction (
-
Utils.
QName.of_string $1)
+ else QNameSet.singleton(
+ QName.processing_instruction (
+ QName.of_string $1)
)), NodeKind.ProcessingInstruction
}
)), NodeKind.ProcessingInstruction
}
-| TAG {
Utils.QNameSet.singleton(Utils.
QName.of_string $1),
+| TAG {
QNameSet.singleton(
QName.of_string $1),
NodeKind.Element
}
;
NodeKind.Element
}
;
@@
-174,7
+176,7
@@
expr:
| expr LTE expr { Binop($1, Lte, $3) }
| expr GT expr { Binop($1, Gt, $3) }
| expr GTE expr { Binop($1, Gte, $3) }
| expr LTE expr { Binop($1, Lte, $3) }
| expr GT expr { Binop($1, Gt, $3) }
| expr GTE expr { Binop($1, Gte, $3) }
-| TAG LP arg_list RP { Fun_call(
Utils.
QName.of_string $1, $3) }
+| TAG LP arg_list RP { Fun_call(QName.of_string $1, $3) }
| LP expr RP { $2 }
| path { Path $1 }
;
| LP expr RP { $2 }
| path { Path $1 }
;