package colibri2

  1. Overview
  2. Docs

Construction

exception InvalidConstantLiteral of int * string
type integer_constant = private
  1. | IConstDec of string
  2. | IConstHex of string
  3. | IConstOct of string
  4. | IConstBin of string
type real_constant = private
  1. | RConstDec of string * string * string option
  2. | RConstHex of string * string * string option
type constant =
  1. | ConstInt of integer_constant
  2. | ConstReal of real_constant
val int_const_dec : string -> integer_constant
val int_const_hex : string -> integer_constant
val int_const_oct : string -> integer_constant
val int_const_bin : string -> integer_constant

these four functions construct integer constant terms from some string s of digits in the corresponding base. Exception InvalidConstantLiteral(base,s) is raised if s contains invalid characters for the given base.

val real_const_dec : string -> string -> string option -> real_constant
val real_const_hex : string -> string -> string option -> real_constant

Printing

type integer_format = (string -> unit, Stdlib.Format.formatter, unit) Stdlib.format
type real_format = (string -> string -> string -> unit, Stdlib.Format.formatter, unit) Stdlib.format
type part_real_format = (string -> string -> unit, Stdlib.Format.formatter, unit) Stdlib.format
type dec_real_format =
  1. | PrintDecReal of part_real_format * real_format
type frac_real_format =
  1. | PrintFracReal of integer_format * part_real_format * part_real_format
type 'a number_support_kind =
  1. | Number_unsupported
  2. | Number_default
  3. | Number_custom of 'a
type integer_support_kind = integer_format number_support_kind
type number_support = {
  1. long_int_support : bool;
  2. dec_int_support : integer_support_kind;
  3. hex_int_support : integer_support_kind;
  4. oct_int_support : integer_support_kind;
  5. bin_int_support : integer_support_kind;
  6. def_int_support : integer_support_kind;
  7. dec_real_support : dec_real_format number_support_kind;
  8. hex_real_support : real_format number_support_kind;
  9. frac_real_support : frac_real_format number_support_kind;
  10. def_real_support : integer_support_kind;
}
val pp : number_support -> Stdlib.Format.formatter -> constant -> unit
OCaml

Innovation. Community. Security.