package owi

  1. Overview
  2. Docs
exception Trap of string
exception Parse_fail of string
type yes =
  1. | Yes
type no =
  1. | No
type with_string_indices = < string_indices : yes >
type without_string_indices = < string_indices : no >
type with_ind_bt = < raw_bt : yes >
type without_ind_bt = < raw_bt : no >
type simplified = < without_string_indices ; without_ind_bt >
type _ indice =
  1. | Text : string -> < with_string_indices.. > indice
  2. | Raw : int -> < .. > indice
val pp_id : Format.formatter -> string -> unit
val pp_id_opt : Format.formatter -> string option -> unit
val pp_indice : Format.formatter -> 'kind indice -> unit
val pp_indice_opt : Format.formatter -> 'a indice option -> unit
val pp_indices : Format.formatter -> 'a indice list -> unit
type nonrec num_type =
  1. | I32
  2. | I64
  3. | F32
  4. | F64
val pp_num_type : Format.formatter -> num_type -> unit
type nullable =
  1. | No_null
  2. | Null
val pp_nullable : Format.formatter -> nullable -> unit
type nonrec packed_type =
  1. | I8
  2. | I16
val pp_packed_type : Format.formatter -> packed_type -> unit
type nonrec mut =
  1. | Const
  2. | Var
val pp_mut : Format.formatter -> mut -> unit
type nonrec nn =
  1. | S32
  2. | S64
val pp_nn : Format.formatter -> nn -> unit
type nonrec sx =
  1. | U
  2. | S
val pp_sx : Format.formatter -> sx -> unit
type nonrec iunop =
  1. | Clz
  2. | Ctz
  3. | Popcnt
val pp_iunop : Format.formatter -> iunop -> unit
type nonrec funop =
  1. | Abs
  2. | Neg
  3. | Sqrt
  4. | Ceil
  5. | Floor
  6. | Trunc
  7. | Nearest
val pp_funop : Format.formatter -> funop -> unit
type nonrec ibinop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div of sx
  5. | Rem of sx
  6. | And
  7. | Or
  8. | Xor
  9. | Shl
  10. | Shr of sx
  11. | Rotl
  12. | Rotr
val pp_ibinop : Format.formatter -> ibinop -> unit
type nonrec fbinop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div
  5. | Min
  6. | Max
  7. | Copysign
val pp_fbinop : Format.formatter -> fbinop -> unit
type nonrec itestop =
  1. | Eqz
val pp_itestop : Format.formatter -> itestop -> unit
type nonrec irelop =
  1. | Eq
  2. | Ne
  3. | Lt of sx
  4. | Gt of sx
  5. | Le of sx
  6. | Ge of sx
val pp_irelop : Format.formatter -> irelop -> Unit.t
type nonrec frelop =
  1. | Eq
  2. | Ne
  3. | Lt
  4. | Gt
  5. | Le
  6. | Ge
val frelop : Format.formatter -> frelop -> Unit.t
type nonrec memarg = {
  1. offset : Int32.t;
  2. align : Int32.t;
}
val pp_memarg : Format.formatter -> memarg -> unit
type nonrec limits = {
  1. min : int;
  2. max : int option;
}
val pp_limits : Format.formatter -> limits -> unit
type nonrec mem = string option * limits
val pp_mem : Format.formatter -> (string option * limits) -> unit
type nonrec final =
  1. | Final
  2. | No_final
val pp_final : Format.formatter -> final -> unit

Structure

Types

type 'a heap_type =
  1. | Any_ht
  2. | None_ht
  3. | Eq_ht
  4. | I31_ht
  5. | Struct_ht
  6. | Array_ht
  7. | Func_ht
  8. | No_func_ht
  9. | Extern_ht
  10. | No_extern_ht
  11. | Def_ht of 'a indice
val pp_heap_type : Format.formatter -> 'a heap_type -> unit
val pp_heap_type_short : Format.formatter -> 'a heap_type -> unit
type nonrec 'a ref_type = nullable * 'a heap_type
val pp_ref_type : Format.formatter -> (nullable * 'a heap_type) -> unit
type nonrec 'a val_type =
  1. | Num_type of num_type
  2. | Ref_type of 'a ref_type
val pp_val_type : Format.formatter -> 'a val_type -> unit
type nonrec 'a param = string option * 'a val_type
val pp_param : Format.formatter -> (string option * 'a val_type) -> unit
type nonrec 'a param_type = 'a param list
val pp_param_type : Format.formatter -> (string option * 'a val_type) list -> unit
type nonrec 'a result_type = 'a val_type list
val pp_result_ : Format.formatter -> 'a val_type -> unit
val pp_result_type : Format.formatter -> 'a val_type list -> unit
val with_space_list : (Format.formatter -> 'a list -> unit) -> Format.formatter -> 'a list -> unit
type 'a block_type =
  1. | Bt_ind : 'a indice -> < with_ind_bt.. > as 'a block_type
  2. | Bt_raw : ('a indice option * ('a param_type * 'a result_type)) -> < .. > as 'a block_type
val pp_block_type : Format.formatter -> 'kind block_type -> unit
val pp_block_type_opt : Format.formatter -> 'a block_type option -> unit
type nonrec 'a func_type = 'a param_type * 'a result_type
val pp_func_type : Format.formatter -> ((string option * 'a val_type) list * 'b val_type list) -> unit
type nonrec 'a table_type = limits * 'a ref_type
val pp_table_type : Format.formatter -> (limits * (nullable * 'a heap_type)) -> unit
type nonrec 'a global_type = mut * 'a val_type
val pp_global_type : Format.formatter -> (mut * 'a val_type) -> unit
type nonrec 'a extern_type =
  1. | Func of string option * 'a func_type
  2. | Table of string option * 'a table_type
  3. | Mem of string option * limits
  4. | Global of string option * 'a global_type

Instructions

type 'a instr =
  1. | I32_const of Int32.t
  2. | I64_const of Int64.t
  3. | F32_const of Float32.t
  4. | F64_const of Float64.t
  5. | I_unop of nn * iunop
  6. | F_unop of nn * funop
  7. | I_binop of nn * ibinop
  8. | F_binop of nn * fbinop
  9. | I_testop of nn * itestop
  10. | I_relop of nn * irelop
  11. | F_relop of nn * frelop
  12. | I_extend8_s of nn
  13. | I_extend16_s of nn
  14. | I64_extend32_s
  15. | I32_wrap_i64
  16. | I64_extend_i32 of sx
  17. | I_trunc_f of nn * nn * sx
  18. | I_trunc_sat_f of nn * nn * sx
  19. | F32_demote_f64
  20. | F64_promote_f32
  21. | F_convert_i of nn * nn * sx
  22. | I_reinterpret_f of nn * nn
  23. | F_reinterpret_i of nn * nn
  24. | Ref_null of 'a heap_type
  25. | Ref_is_null
  26. | Ref_i31
  27. | Ref_func of 'a indice
  28. | Ref_as_non_null
  29. | Ref_cast of nullable * 'a heap_type
  30. | Ref_test of nullable * 'a heap_type
  31. | Ref_eq
  32. | Drop
  33. | Select of 'a val_type list option
  34. | Local_get of 'a indice
  35. | Local_set of 'a indice
  36. | Local_tee of 'a indice
  37. | Global_get of 'a indice
  38. | Global_set of 'a indice
  39. | Table_get of 'a indice
  40. | Table_set of 'a indice
  41. | Table_size of 'a indice
  42. | Table_grow of 'a indice
  43. | Table_fill of 'a indice
  44. | Table_copy of 'a indice * 'a indice
  45. | Table_init of 'a indice * 'a indice
  46. | Elem_drop of 'a indice
  47. | I_load of nn * memarg
  48. | F_load of nn * memarg
  49. | I_store of nn * memarg
  50. | F_store of nn * memarg
  51. | I_load8 of nn * sx * memarg
  52. | I_load16 of nn * sx * memarg
  53. | I64_load32 of sx * memarg
  54. | I_store8 of nn * memarg
  55. | I_store16 of nn * memarg
  56. | I64_store32 of memarg
  57. | Memory_size
  58. | Memory_grow
  59. | Memory_fill
  60. | Memory_copy
  61. | Memory_init of 'a indice
  62. | Data_drop of 'a indice
  63. | Nop
  64. | Unreachable
  65. | Block of string option * 'a block_type option * 'a expr
  66. | Loop of string option * 'a block_type option * 'a expr
  67. | If_else of string option * 'a block_type option * 'a expr * 'a expr
  68. | Br of 'a indice
  69. | Br_if of 'a indice
  70. | Br_table of 'a indice array * 'a indice
  71. | Br_on_cast of 'a indice * 'a ref_type * 'a ref_type
  72. | Br_on_cast_fail of 'a indice * nullable * 'a heap_type
  73. | Br_on_non_null of 'a indice
  74. | Br_on_null of 'a indice
  75. | Return
  76. | Return_call of 'a indice
  77. | Return_call_indirect of 'a indice * 'a block_type
  78. | Return_call_ref of 'a block_type
  79. | Call of 'a indice
  80. | Call_indirect of 'a indice * 'a block_type
  81. | Call_ref of 'a indice
  82. | Array_get of 'a indice
  83. | Array_get_u of 'a indice
  84. | Array_len
  85. | Array_new of 'a indice
  86. | Array_new_data of 'a indice * 'a indice
  87. | Array_new_default of 'a indice
  88. | Array_new_elem of 'a indice * 'a indice
  89. | Array_new_fixed of 'a indice * int
  90. | Array_set of 'a indice
  91. | I31_get_u
  92. | I31_get_s
  93. | Struct_get of 'a indice * 'a indice
  94. | Struct_get_s of 'a indice * 'a indice
  95. | Struct_new of 'a indice
  96. | Struct_new_default of 'a indice
  97. | Struct_set of 'a indice * 'a indice
  98. | Extern_externalize
  99. | Extern_internalize
and 'a expr = 'a instr list
val pp_instr : Format.formatter -> 'a instr -> Unit.t
val pp_expr : Format.formatter -> 'a expr -> Unit.t
type 'a func = {
  1. type_f : 'a block_type;
  2. locals : 'a param list;
  3. body : 'a expr;
  4. id : string option;
}
val pp_local : Format.formatter -> (string option * 'a val_type) -> unit
val pp_locals : Format.formatter -> (string option * 'a val_type) list -> unit
val pp_func : 'kind. Format.formatter -> 'kind func -> unit
val pp_funcs : Format.formatter -> 'a func list -> unit
type 'a table = string option * 'a table_type
val pp_table : Format.formatter -> (string option * (limits * (nullable * 'a heap_type))) -> unit
type 'a import_desc =
  1. | Import_func of string option * 'a block_type
  2. | Import_table of string option * 'a table_type
  3. | Import_mem of string option * limits
  4. | Import_global of string option * 'a global_type
val import_desc : Format.formatter -> 'a import_desc -> Unit.t
type 'a import = {
  1. modul : string;
  2. name : string;
  3. desc : 'a import_desc;
}
val pp_import : Format.formatter -> 'a import -> Unit.t
type 'a export_desc =
  1. | Export_func of 'a indice option
  2. | Export_table of 'a indice option
  3. | Export_mem of 'a indice option
  4. | Export_global of 'a indice option
val pp_export_desc : Format.formatter -> 'a export_desc -> unit
type 'a export = {
  1. name : string;
  2. desc : 'a export_desc;
}
val pp_export : Format.formatter -> text export -> unit
type 'a storage_type =
  1. | Val_storage_t of 'a val_type
  2. | Val_packed_t of packed_type
val pp_storage_type : Format.formatter -> 'a storage_type -> unit
type 'a field_type = mut * 'a storage_type
val pp_field_type : Format.formatter -> (mut * 'a storage_type) -> unit
type 'a struct_field = string option * 'a field_type list
val pp_fields : Format.formatter -> (mut * 'a storage_type) list -> unit
val pp_struct_field : Format.formatter -> (string option * (mut * 'a storage_type) list) -> unit
type 'a struct_type = 'a struct_field list
val pp_struct_type : Format.formatter -> (string option * (mut * 'a storage_type) list) list -> unit
val pp_array_type : Format.formatter -> (mut * 'a storage_type) -> unit
type 'a str_type =
  1. | Def_struct_t of 'a struct_type
  2. | Def_array_t of 'a field_type
  3. | Def_func_t of 'a func_type
val str_type : Format.formatter -> 'a str_type -> unit
type 'a sub_type = final * 'a indice list * 'a str_type
val pp_sub_type : Format.formatter -> (final * 'a indice list * 'b str_type) -> unit
type 'a type_def = string option * 'a sub_type
val pp_type_def : Format.formatter -> (string option * (final * 'a indice list * 'b str_type)) -> unit
type 'a rec_type = 'a type_def list
val pp_rec_type : Format.formatter -> (string option * (final * 'a indice list * 'b str_type)) list -> unit
val pp_start : Format.formatter -> 'a indice -> unit
type 'a const =
  1. | Const_I32 of Int32.t
  2. | Const_I64 of Int64.t
  3. | Const_F32 of Float32.t
  4. | Const_F64 of Float64.t
  5. | Const_null of 'a heap_type
  6. | Const_host of int
  7. | Const_extern of int
  8. | Const_array
  9. | Const_eq
  10. | Const_i31
  11. | Const_struct
val pp_const : Format.formatter -> 'a const -> unit
val pp_consts : Format.formatter -> 'a const list -> unit
OCaml

Innovation. Community. Security.