sequence.mli 1.78 KB
Newer Older
1 2 3 4 5 6
type error = 
  | CopyTag of Types.t * Types.t 
  | CopyAttr of Types.t * Types.t
  | UnderTag of Types.t * exn
exception Error of error

7 8
val nil_type: Types.t
val nil_node: Types.Node.t
9
val nil_atom: Atoms.V.t
10
val nil_cst:  Types.Const.t
11 12 13
val any: Types.t
val seqseq: Types.t
val string: Types.t
14
val string_latin1: Types.t
15
val char_latin1: Types.t
16
val any_xtransformable: Types.t
17

18 19 20
val concat: Types.t -> Types.t -> Types.t
val flatten: Types.t -> Types.t
val map: (Types.t -> Types.t) -> Types.t -> Types.t
21

22
val map_tree: 
23 24 25
  Types.t -> (Types.t -> Types.t -> Types.t * Types.t) -> Types.t -> Types.t
 (* maximal output type -> input type -> (result, residual) *)         
  (* sequence type *)
26

27
val map_mono: Types.t -> Types.t list * (Types.t list -> Types.t)
28
val map_tree_mono: Types.t -> Types.t -> Types.t * Types.t list * (Types.t list -> Types.t)
29 30 31 32
  (* Arguments: domain of all branches, input type.
     Results: input type for all branches, all the individual input types,
     the function to call when all the individual output types have been
     computed *)
33

34
val star: Types.t -> Types.t
35
  (* For a type t, returns [t*] *)
36
val plus: Types.t -> Types.t
37 38
val option: Types.Node.t -> Types.t
  (* returns [t?] *)
39

40 41 42
val repet: int -> int option -> Types.t -> Types.t
  (* min, max *)

43
val approx: Types.t -> Types.t
44 45 46 47 48 49
  (*  For a type t <= [Any*], returns the least type s such that:
      t <= [s*]
      
      In general, for an arbitrary type, returns the least type s such that:
      t <= (X where X = (s, X) |  Any \ (Any,Any))
  *)
50

51 52 53
val ub_concat: Types.t -> Types.t
  (* Returns  [star (approx t)] *)

54 55 56
(* Added this interface needed in cdo2cmo -- Julien *)
val star_node : Types.Node.t -> Types.Node.t

57
  (** given a list of descrs create the sequence type from them *)
58
val seq_of_list: Types.t list -> Types.t
59