package earley

  1. Overview
  2. Docs

Use container to store a point to the rule in stack, we use recursive module for that

type 'a table
type 'b container
type ('b, 'a) elt = ('a, 'b) Types.pre_stack
val create : unit -> 'b container
val create_table : unit -> 'a table
val address : 'b container -> 'b Container.tag
val eq : 'a container -> 'b container -> ('a, 'b) Container.eq
val add : 'a table -> 'b container -> ('a, 'b) elt -> unit
val find : 'a table -> 'b container -> ('a, 'b) elt
val clear : 'a table -> unit
type 'a iter = {
  1. f : 'b. ('a, 'b) elt -> unit;
}
val iter : 'a iter -> 'a table -> unit
type ('a, 'c) fold = {
  1. f : 'b. ('a, 'b) elt -> 'c -> 'c;
}
val fold : ('a, 'c) fold -> 'a table -> 'c -> 'c
OCaml

Innovation. Community. Security.