package GT

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Base class type for all plugins.

Is parametrized by output AST types for convenience. All plugins receive input data as OCaml AST and return pieces specific for backend.

Methods that are specific for a concrete plugin implementation

method virtual trait_name : string

Name of a trait (and of plugin too). It is used for constructing new classes and * functions related to plugin.

method virtual inh_of_main : loc:'loc0 -> Ppxlib.type_declaration -> 'typ0

Inherited attribute for whole type declaration. Is is defined by plugin kind.

method virtual syn_of_main : loc:'loc1 -> ?in_class:bool -> Ppxlib.type_declaration -> 'typ1

Synthesized attribute for whole type declaration. Is is defined by plugin kind.

method virtual syn_of_param : loc:'loc2 -> string -> 'typ2

syn_of_param ~loc name constructs synthethized attribute for type paramter name.

method virtual inh_of_param : loc:'loc3 -> Ppxlib.type_declaration -> string -> 'typ3

inh_of_param ~loc tdecl name constructs inherited attribute for type parameter name.

method virtual plugin_class_params : loc:'loc4 -> Ppxlib.core_type list -> typname:string -> 'typ4 list

The parameters that the plugin class will have in its definition. * Add 'extra manually if needed.

method virtual alias_inherit_type_params : loc:'loc5 -> Ppxlib.type_declaration -> Ppxlib.core_type list -> 'typ5 list

Arguments of inherit class field that will be generated using the types applied in the RHS of type definition.

method virtual extra_class_sig_members : Ppxlib.type_declaration -> 'ctf0 list

Adds a few extra members to a plugin class. Could be some constraints that are difficult to add in place where type parameters are declared.

method virtual extra_class_str_members : Ppxlib.type_declaration -> 'cf0 list

The same as extra_class_sig_members but for structures.

Methods that are specific for all plugins and unlikely will need to be override

method virtual do_single_sig : loc:'loc6 -> is_rec:bool -> Ppxlib.type_declaration -> 'sign0 list

Generate signature items for single type definition.

method virtual do_single : loc:'loc7 -> is_rec:bool -> Ppxlib.type_declaration -> 'str0 list

Generate structure items for single type definition.

method virtual do_typ_gen : loc:'loc8 -> mutual_decls:Ppxlib.type_declaration list -> is_self_rec:(Ppxlib.core_type -> [ `Nonrecursive | `Nonregular | `Regular ]) -> Ppxlib.type_declaration -> Ppxlib.core_type -> 'exp0

Generate transformation expression from specified core_type.

method virtual make_trans_function_name : Ppxlib.type_declaration -> string

Generate name for transformation function.

method virtual make_trans_function_typ : loc:'loc9 -> Ppxlib.type_declaration -> 'typ6

Generate type of a transformation function.

method virtual do_mutuals : loc:'loc10 -> is_rec:bool -> Ppxlib.type_declaration list -> 'str1 list

Generate structure items for mutally recursive type declarations.

method virtual do_mutuals_sigs : loc:'loc11 -> is_rec:bool -> 'sign1 list
method virtual need_inh_attr : bool
method virtual eta_and_exp : center:'exp1 -> Ppxlib.type_declaration -> 'exp1
method virtual prepare_fa_args : 'a. loc:'loc12 -> (loc:'loc12 -> flg:Ppxlib.rec_flag -> pat:'pat0 -> expr:'exp2 -> 'a -> 'a) -> Ppxlib.type_declaration -> 'pat0 list * ('a -> 'a)
method virtual make_final_trans_function_typ : loc:'loc13 -> Ppxlib.type_declaration -> 'typ7
OCaml

Innovation. Community. Security.