# Module Migrate_parsetree.Driver

    module Driver: Migrate_parsetree_driver

# State a rewriter can access

    type extra = ..

    type config = {

`` | `tool_name : `string`;`
`` | `include_dirs : `string list`;`
`` | `load_path : `string list`;`
`` | `debug : `bool`;`
`` | `for_package : `string option`;` | `(*` | Additional parameters that can be passed by a caller of `rewrite_{signature,structure}` to a specific register rewriter. | `*)`
`` | `extras : `extra list`;`

}

    val make_config : tool_name:string ->
           ?include_dirs:string list ->
           ?load_path:string list ->
           ?debug:bool ->
           ?for_package:string ->
           ?extras:extra list ->
           unit -> config

    type cookies

    val get_cookie : cookies ->
           string ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_expression option

    val set_cookie : cookies ->
           string ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_expression -> unit

# Registering rewriters

    type < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
           mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
           out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
           pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
           type_declaration : 'q; type_extension : 'r > rewriter = config ->
           cookies ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_mapper

    val register : name:string ->
           ?reset_args:(unit -> unit) ->
           ?args:(Arg.key * Arg.spec * Arg.doc) list ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           rewriter -> unit

# Running registered rewriters

    val run_as_ast_mapper : string list -> Ast_mapper.mapper

    val run_as_ppx_rewriter : unit -> 'a

    val run_main : unit -> 'a

# Manual mapping

    type some_signature =

`|` | `Sig : `(module Migrate_parsetree_versions.OCaml_version with type Ast.Parsetree.signature = 'concrete) * 'concrete` -> `some_signature``

    type some_structure =

`|` | `Str : `(module Migrate_parsetree_versions.OCaml_version with type Ast.Parsetree.structure = 'concrete) * 'concrete` -> `some_structure``

    val migrate_some_signature : < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           some_signature ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_signature

    val migrate_some_structure : < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           some_structure ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_structure

    val rewrite_signature : config ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_signature ->
           some_signature

    val rewrite_structure : config ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.ocaml_version ->
           < case : 'a; core_type : 'b; expression : 'c; extension_constructor : 'd;
             mapper : 'e; out_class_type : 'f; out_module_type : 'g; out_phrase : 'h;
             out_sig_item : 'i; out_type : 'j; out_type_extension : 'k; out_value : 'l;
             pattern : 'm; signature : 'n; structure : 'o; toplevel_phrase : 'p;
             type_declaration : 'q; type_extension : 'r >
           Migrate_parsetree_versions.get_structure ->
           some_structure