projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Preliminary support for the grammar.
[SXSI/xpathcomp.git]
/
src
/
runtime.ml
diff --git
a/src/runtime.ml
b/src/runtime.ml
index
d74c26a
..
8337d2a
100644
(file)
--- a/
src/runtime.ml
+++ b/
src/runtime.ml
@@
-116,7
+116,7
@@
module Make (U : ResJIT.S) : S with type result_set = U.NS.t =
Translist.fold (fun t (a1, a2) ->
let _, _, _, f = Transition.node t in
let (_, _, fs1), (_, _, fs2) = Formula.st f in
Translist.fold (fun t (a1, a2) ->
let _, _, _, f = Transition.node t in
let (_, _, fs1), (_, _, fs2) = Formula.st f in
- (StateSet.union
s1 fs1, StateSet.union s
2 fs2)
+ (StateSet.union
a1 fs1, StateSet.union a
2 fs2)
) trl (StateSet.empty, StateSet.empty)
in
let ns1 = StateSet.inter s1 orig_s1
) trl (StateSet.empty, StateSet.empty)
in
let ns1 = StateSet.inter s1 orig_s1
@@
-191,7
+191,7
@@
module Make (U : ResJIT.S) : S with type result_set = U.NS.t =
DEFINE LOOP (t, states, ctx) = (
let _t = (t) in
TRACE("top-down-run", 3,
DEFINE LOOP (t, states, ctx) = (
let _t = (t) in
TRACE("top-down-run", 3,
- __ "Entering node %i (tag %s, context %i) with states %a\n%!"
+ __ "Entering node %i
with loop
(tag %s, context %i) with states %a\n%!"
(Node.to_int _t)
(Tag.to_string (Tree.tag tree _t))
(Node.to_int (ctx))
(Node.to_int _t)
(Tag.to_string (Tree.tag tree _t))
(Node.to_int (ctx))
@@
-205,6
+205,12
@@
DEFINE LOOP (t, states, ctx) = (
DEFINE LOOP_TAG (t, states, tag, ctx) = (
let _t = (t) in (* to avoid duplicating expression t *)
DEFINE LOOP_TAG (t, states, tag, ctx) = (
let _t = (t) in (* to avoid duplicating expression t *)
+ TRACE("top-down-run", 3,
+ __ "Entering node %i with loop_tag (tag %s, context %i) with states %a\n%!"
+ (Node.to_int _t)
+ (Tag.to_string (tag))
+ (Node.to_int (ctx))
+ (StateSet.print) (states));
if _t == Tree.nil then nil_res
else
l2jit_dispatch
if _t == Tree.nil then nil_res
else
l2jit_dispatch
@@
-255,9
+261,11
@@
DEFINE LOOP_TAG (t, states, tag, ctx) = (
| L2JIT.NOP () -> nil_res
| L2JIT.FIRST_CHILD s -> LOOP ((Tree.first_child tree t), s, ctx)
| L2JIT.NEXT_SIBLING s -> LOOP ((Tree.next_sibling tree t), s, ctx)
| L2JIT.NOP () -> nil_res
| L2JIT.FIRST_CHILD s -> LOOP ((Tree.first_child tree t), s, ctx)
| L2JIT.NEXT_SIBLING s -> LOOP ((Tree.next_sibling tree t), s, ctx)
+(* | L2JIT.NEXT_SIBLING s -> LOOP ((Tree.next_node_before tree t ctx), s, ctx) *)
| L2JIT.FIRST_ELEMENT s -> LOOP ((Tree.first_element tree t), s, ctx)
| L2JIT.FIRST_ELEMENT s -> LOOP ((Tree.first_element tree t), s, ctx)
- | L2JIT.NEXT_ELEMENT s -> LOOP ((Tree.next_element tree t), s, ctx)
+ | L2JIT.NEXT_ELEMENT s -> LOOP ((Tree.next_element tree t), s, ctx)
+(* | L2JIT.NEXT_ELEMENT s -> LOOP ((Tree.next_node_before tree t ctx), s, ctx) *)
| L2JIT.TAGGED_DESCENDANT (s, tag) ->
LOOP_TAG ((Tree.tagged_descendant tree t tag), s, tag, ctx)
| L2JIT.TAGGED_DESCENDANT (s, tag) ->
LOOP_TAG ((Tree.tagged_descendant tree t tag), s, tag, ctx)