module Pa_type_conv: sig
.. end
Pa_type_conv: Preprocessing Module for Registering Type Conversions
Generator registration
val add_generator : string -> (Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.str_item) -> unit
add_generator name gen
adds the code generator gen
, which
maps type declarations to structure items. Note that the original
type declaration get added automatically in any case.
val rem_generator : string -> unit
rem_generator name
removes the code generator named name
.
val add_sig_generator : string -> (Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.sig_item) -> unit
add_generator name gen
adds the code generator gen
, which
maps type declarations to signature items. Note that the original
type declaration get added automatically in any case.
val rem_sig_generator : string -> unit
rem_sig_generator name
removes the code signature generator named
name
.
val get_conv_path : unit -> string
get_conv_path ()
Returns the name to module containing a type
as required for error messages.
Utility functions
val get_loc_err : Camlp4.PreCast.Ast.Loc.t -> string -> string
get_loc_err loc msg
generates a compile-time error message.
val hash_variant : string -> int
hash_variant str
Returns the integer encoding a variant tag with
name str
.
General purpose code generation module
module Gen: sig
.. end