- let cache = Cache.Lvl3.create 1024 L3JIT.dummy in
- let rec loop_leaves l acc =
- match l with
- [] -> acc
- | node :: ll ->
- let res, lll = bottom_up_next node ll Tree.nil in
- if (lll <> []) then
- begin
- eprintf "Leftover nodes: %i\n" (List.length lll);
- end;
- res
-
- and bottom_up_next node rest stop =
- let fs = Tree.first_child tree node in
- let res1 =
- if fs == Tree.nil then nil_res
- else full_top_down_run auto states tree fs
- in
- move_up node res1 true rest stop
-
- and move_up node res is_left rest stop =