`sig
type error = CannotRun of string | WrongMagic of string
exception Error of Pparse.error
val preprocess : string -> string
val remove_preprocessed : string -> unit
type 'a ast_kind =
Structure : Parsetree.structure Pparse.ast_kind
| Signature : Parsetree.signature Pparse.ast_kind
val read_ast : 'a Pparse.ast_kind -> string -> 'a
val write_ast : 'a Pparse.ast_kind -> string -> 'a -> unit
val file :
Format.formatter ->
tool_name:string ->
string -> (Lexing.lexbuf -> 'a) -> 'a Pparse.ast_kind -> 'a
val apply_rewriters :
?restore:bool -> tool_name:string -> 'a Pparse.ast_kind -> 'a -> 'a
val apply_rewriters_str :
?restore:bool ->
tool_name:string -> Parsetree.structure -> Parsetree.structure
val apply_rewriters_sig :
?restore:bool ->
tool_name:string -> Parsetree.signature -> Parsetree.signature
val report_error : Format.formatter -> Pparse.error -> unit
val parse_implementation :
Format.formatter -> tool_name:string -> string -> Parsetree.structure
val parse_interface :
Format.formatter -> tool_name:string -> string -> Parsetree.signature
val call_external_preprocessor : string -> string -> string
val open_and_check_magic : string -> string -> Pervasives.in_channel * bool
module ImplementationHooks :
sig
type t = Parsetree.structure
val add_hook : string -> (Misc.hook_info -> t -> t) -> unit
val apply_hooks : Misc.hook_info -> t -> t
end
module InterfaceHooks :
sig
type t = Parsetree.signature
val add_hook : string -> (Misc.hook_info -> t -> t) -> unit
val apply_hooks : Misc.hook_info -> t -> t
end
end`