pretty.mli 655 Bytes
Newer Older
1 2 3 4 5 6 7 8
(* Decompilation of regular expressions *)

type 'a regexp = 
  | Empty
  | Epsilon
  | Seq of 'a regexp * 'a regexp
  | Alt of 'a regexp * 'a regexp
  | Star of 'a regexp
9
  | Plus of 'a regexp
10 11
  | Trans of 'a

12 13 14 15 16 17 18
module type S = sig
  type t
  val equal: t -> t -> bool
  val compare: t -> t -> int
  val hash: t -> int
end

19 20 21 22 23 24 25 26 27
module type TABLE = sig
  type key
  type 'a t
  val create: int -> 'a t
  val add: 'a t -> key -> 'a -> unit
  val find: 'a t -> key -> 'a
end

module Decompile(X : TABLE)(S : S)
28
: sig
29 30 31
  val decompile: (X.key -> [ `T of (S.t * X.key) list * bool
                           | `Eps of S.t * X.key]
			   ) -> X.key -> S.t regexp
32
end