6 let write name ~ocaml ~byte =
7 printf "type %s = %s\n" name ocaml;
8 printf "let write_%s= %s\n" name byte
11 write name ~ocaml:"int" ~byte:"u30"
14 printf "let c_%s _x = %s\n" name cpool
16 let high name ~ocaml ~cpool =
17 printf "type %s = %s\n" name ocaml;
21 high name ~ocaml ~cpool:"None"
23 let cpool name ~ocaml ~entry =
24 high name ~ocaml ~cpool:(sprintf "Some (`%s _x)" entry)
27 match Sys.argv.(1) with
38 write "u8" ~ocaml:"int" ~byte:"u8";
40 ~ocaml:"(Label.t,int) either"
42 Left label -> label_ref label
43 | Right address -> s24 address"
45 cpool "c_int" ~ocaml:"int" ~entry:"Int";
46 cpool "c_uint" ~ocaml:"int" ~entry:"Int";
47 cpool "c_string" ~ocaml:"string" ~entry:"String";
48 cpool "c_float" ~ocaml:"float" ~entry:"Double";
49 cpool "namespace" ~ocaml:"Cpool.namespace" ~entry:"Namespace";
50 cpool "multiname" ~ocaml:"Cpool.multiname" ~entry:"Multiname";
51 lit "label" ~ocaml:"Label.t";
52 lit "u30" ~ocaml:"int";
53 lit "u8" ~ocaml:"int";
54 base "label" ~cpool:"None";
55 base "method_" ~cpool:"None";
56 base "class_" ~cpool:"None";