Ast.TypSourceTypes
This modules allows extending Mopsa with new types. This is done by extending the type typ with new variants. For example
type typ += T_intextends Mopsa types with a new integer type. Registration is performed with
let () = register_typ {
compare = (fun next -> next);
print = (fun next -> function
| T_int -> Format.pp_print_string fmt "int"
| t -> next fmt t
);
}Note that is this simple example where the type doesn't have an inner structure no comparison function is required as Stdlib.compare is sufficient to provide a total order.