Structure parsers reintroduced. ** NOT WORKING **
[virt-mem.git] / extract / codegen / code_generation.mli
index efe282f..36140cd 100644 (file)
@@ -39,12 +39,30 @@ val generate_types :
        - content field structures
     *)
 
+(** {2 Generate parsers} *)
+
+val generate_parsers : (string * Struct_classify.parser_ list) list ->
+  Camlp4.PreCast.Syntax.Ast.str_item * Camlp4.PreCast.Syntax.Ast.sig_item
+  * (string, string) Hashtbl.t
+    (** [generate_parsers] generates the parser functions.
+
+       We cannot generate the complete code here because we
+       don't want camlp4 parsing this file to substitute bitmatch
+       code yet.  So we only generate labels, which get substituted
+       by the contents of the returned hash table in {!output_implem}.
+    *)
+
 (** {2 Output final files} *)
 
 val output_interf : output_file:string ->
-  Camlp4.PreCast.Syntax.Ast.sig_item -> unit
+  Camlp4.PreCast.Syntax.Ast.sig_item ->
+  Camlp4.PreCast.Syntax.Ast.sig_item ->
+  unit
   (** Output the interface file. *)
 
 val output_implem : output_file:string ->
-  Camlp4.PreCast.Syntax.Ast.str_item -> unit
+  Camlp4.PreCast.Syntax.Ast.str_item ->
+  Camlp4.PreCast.Syntax.Ast.str_item ->
+  (string, string) Hashtbl.t ->
+  unit
   (** Output the implementation file. *)