1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(* Time-stamp: <modified the 05/04/2019 (at 11:27) by Erwan Jahier> *)typevar=Data.ident*Data.t(* Source info related to the current control point. Its content
depends on the plugin it comes from. *)typesrc_info_atom={str:string;file:string;line:int*int;(* line nb begin/end in file *)char:int*int;(* char nb begin/end in file *)stack:src_info_atomoption;}typesrc_info={expr:Expr.t;(* holds info about the current control point *)atoms:src_info_atomlist;more:(unit->Expr.t)option;(* more (costly) info *)in_subst:(var*var)list;(* relate input args and parameters *)out_subst:(var*var)list;(* relate output args and parameters *)}(* a.k.a. ports in the Prolog Byrd's box model *)typekind=Ltop|Call|Exit|MicroStepofstring(* holds info related to the sub-lang micro-step *)typet={nb:int;step:int;depth:int;data:Data.substlist;next:unit->t;terminate:unit->unit;reset:unit->unit;save_state:int->unit;restore_state:int->unit;kind:kind;name:string;lang:string;inputs:varlist;outputs:varlist;locals:varlist;sinfo:(unit->src_info)option}(* raised by next when there is no next event. Holds the event number.*)exceptionEndofintexceptionErrorofstring*tletset_nbei={ewithnb=i}letincr_event_nbctx={ctxwithnb=ctx.nb+1}letdecr_event_depthctx={ctxwithdepth=ctx.depth-1}letincr_event_depthctx={ctxwithdepth=ctx.depth+1}(****************************************************************)(* printers (for toplevel) *)let(print_expr:Format.formatter->Expr.t->unit)=funffe->Format.fprintfff"%s"(Expr.to_stringe);(* let (print_src_info : Format.formatter -> src_info -> unit) = *)(* fun ff si -> *)(* Format.fprintf ff "%s" (Expr.to_string si.expr) *)