module Pa_type_conv:sig..end
Pa_type_conv: Preprocessing Module for Registering Type Conversions
val set_conv_path_if_not_set : Camlp4.PreCast.Ast.Loc.t -> unitset_conv_path_if_not_set loc sets the path to the file/module being
converted for improved error messages.
val get_conv_path : unit -> stringget_conv_path ()
val add_generator : ?is_exn:bool ->
string ->
(bool -> Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.str_item) -> unitadd_generator ?is_exn name gen adds the code generator gen,
which maps type or exception declarations to structure items, where
is_exn specifies whether the declaration is an exception. Note that
the original type/exception declarations get added automatically in
any case.
is_exn : = falseval add_generator_with_arg : ?is_exn:bool ->
string ->
'a Camlp4.PreCast.Gram.Entry.t ->
('a option -> bool -> Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.str_item) ->
unitadd_generator_with_arg ?is_exn name entry generator same as
add_generator, but the generator may accept an argument, which is
parsed with entry.
val rm_generator : ?is_exn:bool -> string -> unitrm_generator ?is_exn name removes the code generator named name
for types if is_exn is false, or exceptions otherwise.
is_exn : = falseval add_sig_generator : ?delayed:bool ->
?is_exn:bool ->
string ->
(bool -> Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.sig_item) -> unitadd_sig_generator ?delayed ?is_exn name gen adds the code generator gen,
which maps type or exception declarations to signature items, where
is_exn specifies whether the declaration is an exception. Note that the
original type/exception declarations get added automatically in any case. If
delayed is set to true, the output of this generator is appended to the
signature in which it's defined
delayed : = falseis_exn : = falseval add_sig_generator_with_arg : ?delayed:bool ->
?is_exn:bool ->
string ->
'a Camlp4.PreCast.Gram.Entry.t ->
('a option -> bool -> Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.sig_item) ->
unitadd_sig_generator_with_arg ?delayed ?is_exn name entry generator same as
add_sig_generator, but the generator may accept an argument,
which is parsed with entry.
val rm_sig_generator : ?is_exn:bool -> string -> unitrm_sig_generator ?is_exn name removes the signature code generator named
name for types if is_exn is false, or exceptions otherwise.
is_exn : = falsetyperecord_field_generator =Camlp4.PreCast.Ast.ctyp -> unit
Type of record field code generators
val add_record_field_generator : string -> record_field_generator -> unitadd_record_field_generator gen_name gen adds the record field code
generator gen with name gen_name, which acts on the location
identifying the record field.
val add_record_field_generator_with_arg : string ->
'a Camlp4.PreCast.Gram.Entry.t ->
('a option -> record_field_generator) -> unitadd_record_field_generator_with_arg name entry generator same as
add_record_field_generator, but the generator takes an argument,
which is parsed with entry. If None is passed to the generator,
parsing of the argument failed, otherwise Some arg will be passed,
where arg is the successfully parsed argument.
val rm_record_field_generator : string -> unitrm_record_field_generator name removes the record field code generator
named name.
val add_sig_set : ?is_exn:bool -> string -> set:string list -> unitadd_sig_set ?is_exn id ~set adds the generator id to the list
of generators for signatures.
This generator will behave as if is all the generators from set
had been given instead. Any duplicate arising from repeatedly
expanding such generators are removed.
If is_exn, then it is a generator for exception declaration, or
else it is a generator for type declaration.
val add_str_set : ?is_exn:bool -> string -> set:string list -> unitadd_str_set ?is_exn id ~set behaves exactly like
add_sig_set ?is_exn id ~set but for structure items instead of
signatures items.
val add_set : kind:[ `Both | `Sig | `Str ] ->
is_exn:[ `Both | `No | `Yes ] -> string -> set:string list -> unitadd_set ~kind ~is_exn id ~set is a shorthand for doing multiple
calls to add_str_set and add_sig_set
val get_loc_err : Camlp4.PreCast.Ast.Loc.t -> string -> stringget_loc_err loc msg generates a compile-time error message.
val hash_variant : string -> inthash_variant str
str.module Gen:sig..end
module Rewrite_tds:sig..end