| 1 |
open Ident
|
| 2 |
open Encodings
|
| 3 |
|
| 4 |
type t =
|
| 5 |
(* Canonical representation *)
|
| 6 |
| Pair of t * t
|
| 7 |
| Xml of t * t * t
|
| 8 |
| Record of t label_map
|
| 9 |
| Atom of Atoms.V.t
|
| 10 |
| Integer of Intervals.V.t
|
| 11 |
| Char of Chars.V.t
|
| 12 |
| Abstraction of (Types.descr * Types.descr) list * (t -> t)
|
| 13 |
| Abstraction2 of t array * (Types.t * Types.t) list * Lambda.branches
|
| 14 |
| Abstract of Types.Abstract.V.t
|
| 15 |
|
| 16 |
(* Derived forms *)
|
| 17 |
| String_latin1 of int * int * string * t
|
| 18 |
| String_utf8 of U.uindex * U.uindex * U.t * t
|
| 19 |
| Concat of t * t
|
| 20 |
|
| 21 |
(* Special value for absent record fields, and failed pattern matching *)
|
| 22 |
| Absent
|
| 23 |
|
| 24 |
(* Only in evaluation environment *)
|
| 25 |
| Delayed of t ref
|
| 26 |
|
| 27 |
module ValueSet: Set.S with type elt = t
|
| 28 |
|
| 29 |
exception CDuceExn of t
|
| 30 |
val raise': t -> 'a (* "raise" for CDuce exceptions *)
|
| 31 |
val failwith': string -> 'a (* "failwith" for CDuce exceptions *)
|
| 32 |
|
| 33 |
val print: Format.formatter -> t -> unit
|
| 34 |
val dump_xml: Format.formatter -> t -> unit
|
| 35 |
|
| 36 |
val normalize: t -> t
|
| 37 |
(* Transform a derived form to its canonical equivalent *)
|
| 38 |
|
| 39 |
val const : Types.const -> t (* extract the const value from a const type *)
|
| 40 |
val inv_const : t -> Types.const (* build a const type from a const value *)
|
| 41 |
val string_latin1 : string -> t
|
| 42 |
val string_utf8 : U.t -> t
|
| 43 |
val substring_utf8: U.uindex -> U.uindex -> U.t -> t -> t
|
| 44 |
val nil : t
|
| 45 |
val vtrue : t
|
| 46 |
val vfalse : t
|
| 47 |
val vbool : bool -> t
|
| 48 |
|
| 49 |
(** @return a Record value from an associative list of fields *)
|
| 50 |
val vrecord : (Ns.qname * t) list -> t
|
| 51 |
|
| 52 |
val sequence : t list -> t
|
| 53 |
val sequence_rev : t list -> t
|
| 54 |
val get_sequence : t -> t list
|
| 55 |
val get_sequence_rev : t -> t list
|
| 56 |
|
| 57 |
val atom_ascii : string -> t
|
| 58 |
val label_ascii : string -> label
|
| 59 |
val record : (label * t) list -> t
|
| 60 |
val get_field : t -> label -> t
|
| 61 |
|
| 62 |
val get_variant : t -> string * t option
|
| 63 |
|
| 64 |
val abstract : Types.Abstract.abs -> 'a -> t
|
| 65 |
val get_abstract : t -> 'a
|
| 66 |
|
| 67 |
(* iterator on the content of an Xml value. First callback is invoked on Utf8
|
| 68 |
character children; second callback is invoked on other children values *)
|
| 69 |
val iter_xml : (U.t -> unit) -> (t -> unit) -> t -> unit
|
| 70 |
|
| 71 |
(* as above for map *)
|
| 72 |
val map_xml : (U.t -> U.t) -> (t -> t) -> t -> t
|
| 73 |
|
| 74 |
val concat : t -> t -> t
|
| 75 |
val flatten : t -> t
|
| 76 |
|
| 77 |
|
| 78 |
val get_string_latin1 : t -> string
|
| 79 |
val get_string_utf8 : t -> U.t * t
|
| 80 |
val is_str : t -> bool
|
| 81 |
val is_seq : t -> bool
|
| 82 |
|
| 83 |
val get_int : t -> int
|
| 84 |
|
| 85 |
(** @return an associative list of fields from a Record value *)
|
| 86 |
val get_fields : t -> (Ns.qname * t) list
|
| 87 |
|
| 88 |
val get_pair : t -> t * t
|
| 89 |
|
| 90 |
val compare : t -> t -> int
|
| 91 |
val equal : t -> t -> bool
|
| 92 |
val ( |<| ): t -> t -> bool
|
| 93 |
val ( |>| ): t -> t -> bool
|
| 94 |
val ( |<=| ): t -> t -> bool
|
| 95 |
val ( |>=| ): t -> t -> bool
|
| 96 |
val ( |=| ): t -> t -> bool
|
| 97 |
val ( |<>| ): t -> t -> bool
|
| 98 |
|
| 99 |
|
| 100 |
val set_cdr : t -> t -> unit
|
| 101 |
val append_cdr : t -> t -> t
|
| 102 |
|