sequence.mli 1.71 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

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

28
val map_mono: Types.t -> Types.t list * (Types.t list -> Types.t)
29
val map_tree_mono: Types.t -> Types.t -> Types.t * Types.t list * (Types.t list -> Types.t)
30
31
32
33
  (* 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 *)
34

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

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

44
val approx: Types.t -> Types.t
45
46
47
48
49
50
  (*  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))
  *)
51

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

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