Commit 7fa6a0fd authored by POTTIER Francois's avatar POTTIER Francois

New function [Production.mapnt].

parent 7ffc6d5a
......@@ -787,6 +787,10 @@ module Production = struct
in
loop accu k
let mapnt nt f =
let k, k' = ntprods.(nt) in
Misc.mapij k k' f
(* This funny variant is lazy. If at some point [f] does not demand its
second argument, then iteration stops. *)
let foldnt_lazy (nt : Nonterminal.t) (f : index -> (unit -> 'a) -> 'a) (seed : 'a) : 'a =
......
......@@ -460,6 +460,7 @@ module Production : sig
val iternt: Nonterminal.t -> (index -> unit) -> unit
val foldnt: Nonterminal.t -> 'a -> (index -> 'a -> 'a) -> 'a
val mapnt: Nonterminal.t -> (index -> 'a) -> 'a list
(* This allows determining whether a production is a start
production. If it is a start production, the start symbol that it
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment