1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
(**************************************************************************)
(* The CDuce compiler *)
(* Alain Frisch <Alain.Frisch@inria.fr> and the CDuce team *)
(* Copyright CNRS,INRIA, 2003,2004,2005,2006,2007 (see LICENSE for details) *)
(**************************************************************************)
(* 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
| Plus of 'a regexp
| Trans of 'a
module type S = sig
type t
val equal: t -> t -> bool
val compare: t -> t -> int
val hash: t -> int
end
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)
: sig
val decompile: (X.key -> [ `T of (S.t * X.key) list * bool
| `Eps of S.t * X.key]
) -> X.key -> S.t regexp
end
|