Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Nanocaml.Passtype fun_arg =
Nanocaml.Ast.Asttypes.arg_label * Ast.expression option * Ast.patterntype np_pass = {npp_name : string;npp_loc : Nanocaml.Ast.Location.t;npp_input : Lang.np_language;npp_output : Lang.np_language;npp_pre : Ast.expression -> Ast.expression;npp_post : Ast.expression;npp_procs : np_processor list;}represents a nanopass definition *
and np_processor = {npc_name : string;npc_loc : Nanocaml.Ast.Location.t;npc_dom : Lang.np_nonterm;npc_cod : Lang.np_nonterm option;npc_args : fun_arg list;npc_clauses : clause list;npc_clauses_loc : Nanocaml.Ast.Location.t;}represents a processor definition (a transformation between nonterminals in a nanopass) *
and clause = np_pat * Ast.expressionrepresents a pattern in a production. the pattern must be parsed by nanocaml so that we can correctly map over lists and apply catamorphims, e.g. for expressions like (x, e [@r]) [@l]. *
val loc_of_pat : np_pat -> Nanocaml.Ast.Location.treturns the Location.t of the given pattern. *
val processor_of_rhs :
name:string ->
dom:Lang.np_nonterm ->
cod:Lang.np_nonterm option ->
loc:Nanocaml.Ast.Location.t ->
Ast.expression ->
np_processorconvert the RHS of a let into a np_processor. *
val pat_of_pattern : Ast.pattern -> np_patconvert a pattern into a np_pat. *
val extract_pass_sig :
Ast.expression ->
(string * Migrate_parsetree__Ast_405.Location.t)
* (string * Migrate_parsetree__Ast_405.Location.t)extract L0 and L1 out of expression of form L0 --> L1. returns ("L0", loc_L0), ("L1", loc_L1) (for this particular example). *
val extract_dom_cod :
loc:Nanocaml.Ast.Location.t ->
Lang.np_language ->
Lang.np_language ->
string ->
Lang.np_nonterm * Lang.np_nonterm optionextract domain and co-domain from the name of a production. the rules are: y_of_x => dom="x", cod="y" x_to_y => dom="x", cod="y" x => dom=cod="x" x_f => dom="x", cof=None
if the co-domain is not a valid nonterm of the output language, then the co-domain is None.
given the string name, returns dom, opt_cod. *
val pass_of_value_binding : Ast.value_binding -> np_passconvert a value_binding into a np_pass