`sig
module type Loc = sig val _loc : Camlp4.PreCast.Loc.t end
module type AstHelpers =
sig
module Untranslate : Type.Untranslate
val seq :
Camlp4.PreCast.Ast.expr ->
Camlp4.PreCast.Ast.expr -> Camlp4.PreCast.Ast.expr
val seq_list : Camlp4.PreCast.Ast.expr list -> Camlp4.PreCast.Ast.expr
val record_pattern :
?prefix:string -> Type.field list -> Camlp4.PreCast.Ast.patt
val record_expr :
(string * Camlp4.PreCast.Ast.expr) list -> Camlp4.PreCast.Ast.expr
val record_expression :
?prefix:string -> Type.field list -> Camlp4.PreCast.Ast.expr
val expr_list : Camlp4.PreCast.Ast.expr list -> Camlp4.PreCast.Ast.expr
val patt_list : Camlp4.PreCast.Ast.patt list -> Camlp4.PreCast.Ast.patt
val tuple_expr :
Camlp4.PreCast.Ast.expr list -> Camlp4.PreCast.Ast.expr
val tuple :
?param:string ->
int ->
string list * Camlp4.PreCast.Ast.patt * Camlp4.PreCast.Ast.expr
val cast_pattern :
Type.qname Type.NameMap.t ->
?param:string ->
Type.expr ->
Camlp4.PreCast.Ast.patt * Camlp4.PreCast.Ast.expr *
Camlp4.PreCast.Ast.expr
val modname_from_qname :
qname:string list -> classname:string -> Camlp4.PreCast.Ast.ident
end
module type Generator =
sig
type context
module Loc : Loc
module AstHelpers : AstHelpers
val cast_pattern :
Defs.Generator.context ->
?param:string ->
Type.expr ->
Camlp4.PreCast.Ast.patt * Camlp4.PreCast.Ast.expr *
Camlp4.PreCast.Ast.expr
val instantiate_modargs_repr :
Defs.Generator.context -> Type.repr -> Type.repr
class virtual generator :
object
method call_expr :
Defs.Generator.context ->
Type.expr -> string -> Camlp4.PreCast.Ast.expr
method call_poly_expr :
Defs.Generator.context ->
Type.poly_expr -> string -> Camlp4.PreCast.Ast.expr
method class_ :
Defs.Generator.context ->
[ `NYI ] -> Camlp4.PreCast.Ast.str_item list
method class_sig :
Type.qname Type.NameMap.t ->
Type.expr -> Camlp4.PreCast.Ast.module_type
method constr :
Defs.Generator.context ->
Type.qname * Type.expr list -> Camlp4.PreCast.Ast.module_expr
method expr :
Defs.Generator.context ->
Type.expr -> Camlp4.PreCast.Ast.module_expr
method function_ :
Defs.Generator.context ->
Type.expr * Type.expr -> Camlp4.PreCast.Ast.str_item list
method gparam :
Defs.Generator.context ->
Type.param * Type.expr -> Camlp4.PreCast.Ast.module_expr
method gsum :
?eq:Type.expr ->
Defs.Generator.context ->
Type.name ->
Type.expr list ->
Type.constraint_ list ->
Type.gsummand list -> Camlp4.PreCast.Ast.str_item list
method label :
Defs.Generator.context ->
[ `NonOptional | `Optional ] * Type.name * Type.expr * Type.expr ->
Camlp4.PreCast.Ast.str_item list
method object_ :
Defs.Generator.context ->
[ `NYI ] -> Camlp4.PreCast.Ast.str_item list
method pack :
Type.qname Type.NameMap.t ->
Type.expr ->
Camlp4.PreCast.Ast.module_expr -> Camlp4.PreCast.Ast.expr
method param :
Defs.Generator.context ->
Type.param -> Camlp4.PreCast.Ast.module_expr
method virtual proxy :
unit -> Type.name option * Camlp4.PreCast.Ast.ident list
method virtual record :
?eq:Type.expr ->
Defs.Generator.context ->
Type.name ->
Type.expr list ->
Type.constraint_ list ->
Type.field list -> Camlp4.PreCast.Ast.str_item list
method rhs :
Defs.Generator.context ->
Type.subst -> Type.decl -> Camlp4.PreCast.Ast.module_expr
method virtual sum :
?eq:Type.expr ->
Defs.Generator.context ->
Type.name ->
Type.expr list ->
Type.constraint_ list ->
Type.summand list -> Camlp4.PreCast.Ast.str_item list
method virtual tuple :
Defs.Generator.context ->
Type.expr list -> Camlp4.PreCast.Ast.str_item list
method unpack :
Type.qname Type.NameMap.t ->
Type.expr ->
Camlp4.PreCast.Ast.expr -> Camlp4.PreCast.Ast.module_expr
method virtual variant :
Defs.Generator.context ->
Type.name ->
Type.expr list ->
Type.constraint_ list ->
Type.variant -> Camlp4.PreCast.Ast.str_item list
method wrap :
Defs.Generator.context ->
?default:Type.name option ->
Type.expr ->
Camlp4.PreCast.Ast.str_item list ->
Camlp4.PreCast.Ast.module_expr
end
val generate :
Defs.Generator.generator ->
Type.decl list -> Camlp4.PreCast.Ast.str_item
val generate_sigs :
Defs.Generator.generator ->
Type.decl list -> Camlp4.PreCast.Ast.sig_item
val generate_expr :
Defs.Generator.generator ->
Camlp4.PreCast.Ast.module_expr Type.EMap.t ->
Type.qname Type.NameMap.t ->
Type.expr -> Camlp4.PreCast.Ast.module_expr
end
module type Class =
sig
val generate : Type.decl list -> Camlp4.PreCast.Ast.str_item
val generate_sigs : Type.decl list -> Camlp4.PreCast.Ast.sig_item
end
module type ClassBuilder = functor (Generator : Generator) -> Class
module type InnerClassBuilder = functor (Loc : Loc) -> Class
module type FullClass =
sig
val classname : Type.name
val runtimename : Type.name
val generate : Type.decl list -> Camlp4.PreCast.Ast.str_item
val generate_sigs : Type.decl list -> Camlp4.PreCast.Ast.sig_item
val generate_expr :
Camlp4.PreCast.Ast.module_expr Type.EMap.t ->
Type.qname Type.NameMap.t ->
Type.expr -> Camlp4.PreCast.Ast.module_expr
end
module type FullBuilder = functor (Generator : Generator) -> FullClass
module type DepClassBuilder = functor (Loc : Loc) -> FullClass
module type ClassDescription =
sig
val classname : Type.name
val runtimename : Type.name
val default_module : Type.name option
val alpha : Type.name option
val allow_private : bool
val predefs : (Type.qname * Type.qname) list
val depends : (module Defs.DepClassBuilder) list
end
type generator = (module Defs.InnerClassBuilder)
module type FullClassBuilder = functor (Loc : Loc) -> FullClass
end`