earley

Parsing library based on Earley Algorithm
IN THIS PACKAGE
type t

Type of a container cell

type 'a table

Type of a container table. You must create a container table of type a table to store value of type a in a container cell. Many table can have the same type, the value are associated to the pair (cell, table), not just to the cell.

val create : unit -> t

create () creates a new container cell

val add : 'a table -> t -> 'a -> unit

add tab cell v associates the value v to the pair (tab, cell). complexity if O(N) where N is the number of tables with a value associated to this cell.

val find : 'a table -> t -> 'a

find tab cell return the value associated to (tab, cell). raises Not_found if the are no such value

val clear : 'a table -> unit

clear tab removed all value associated to a table.

val create_table : unit -> 'a table

create_table () creates a new table

type _ tag = ..

GADT to represent types in the syntax (extended when needed).

val address : t -> unit tag

address n return a unique id of each cell

type ('a, 'b) eq =
| Y : ( 'a, 'a ) eq
| N : ( 'a, 'b ) eq

Standard eq-type.

module type Param = sig ... end
val eq : t -> t -> bool
module Make (T : sig ... end) : Param with type ('a, 'b) elt = ( 'a, 'b ) T.elt
type ('a, 'b) elt = 'a
type 'a iter = {
f : 'b. ( 'a, 'b ) elt -> unit;
}
val iter : 'a iter -> 'a table -> unit
type ('a, 'c) fold = {
f : 'b. ( 'a, 'b ) elt -> 'c -> 'c;
}
val fold : ( 'a, 'c ) fold -> 'a table -> 'c -> 'c
module Ref : Param with type ('a, 'b) elt = 'b