.\" groff -man -Tascii atdgen.1 .\" ========================================================================== .\" ============= Synopsis =================================================== .\" ========================================================================== .TH ATDGEN 1 "May 2013" ATDGEN "User Manuals" .SH NAME atdgen \- ATD compiler and code generator .SH SYNOPSIS .B atdgen \fR[\fIoptions...\fR] [\fIatd-file\fR] .\" ========================================================================== .\" ============= Description ================================================ .\" ========================================================================== .SH DESCRIPTION .B atdgen reads .B ATD type definitions and generates .B OCaml code (both ml and mli files) for .IP \(em 2 type definitions (option .I -t\fR) .IP \(em serializers and deserializers for Biniou (option .I -b\fR) .IP \(em serializers and deserializers for JSON (option .I -j\fR) .IP \(em record-creating functions supporting default fields (option .I -v\fR) .IP \(em user-specified data validators (option .I -v\fR) .\" ========================================================================== .P If no mode option (\fI-t\fR, \fI-b\fR, \fI-j\fR or \fI-v\fR) is given, then .I -t -b is assumed. Unless .I -o is present, the .I for the generated files is derived from the .I atd-file argument. If the .I atd-file argument is omitted, .B atdgen reads .B ATD sources from standard input, if additionally .I -o is missing, it behaves as if .I -o - was given. .\" .\" ========================================================================== .\" ================ Options ================================================= .\" ========================================================================== .\" .SH OPTIONS .\" ===================== -t ================================================ .TP .B "-t" Produce files .I _t.mli and .I _t.ml containing OCaml type definitions for the .B ATD input .\" ===================== -b ================================================ .TP .B "-b" Produce files .I _b.mli and .I _b.ml containing .B OCaml serializers and deserializers for the .B Biniou data format .\" ===================== -j ================================================ .TP .B "-j" produce files .I _j.mli and .I _j.ml containing .B OCaml serializers and deserializers for the .B JSON data format .\" ===================== -v ================================================ .TP .B "-v" Produce files .I _v.mli and .I _v.ml containing OCaml functions for creating records and validators, see also option .I -validate\fR. .\" ===================== -dep ============================================== .TP .B "-dep" Output dependencies in makefile-format for all possible .B atdgen output files and exit .\" ===================== -list ============================================= .TP .B "-list" Output a space-separated list of all possible .B atdgen output files and exit .\" ===================== -o [ PREFIX | - ] ================================== .TP .B "-o " .RS set the .I for the options .I -t\fR, \fI-b\fR and \fI-j\fR. If .I is .I -\fR, .B atdgen writes code in the form of .P .RS struct ... end : sig ... end .RE .P to standard output. .RE .\" ===================== -biniou =========================================== .TP .B "-biniou" [deprecated] same as .I -t -b\fR, i.e., produce serializers and deserializers for Biniou and .B OCaml type definitions (default) .\" ===================== -json ============================================= .TP .B "-json" [deprecated] same as .I -t -j\fR, i.e., produce serializers and deserializers for JSON and .B OCaml type definitions. .\" ===================== -j-std ============================================ .TP .B "-j-std" standard .B JSON\fR: Convert tuples and variants into standard .B JSON and refuse to print NaN and infinities. This option implies .I -json unless another mode is specified. .\" ===================== -std-json ========================================= .TP .B "-std-json" [deprecated] same as .I -j-std .\" ===================== -j-pp ======================================= .TP .B "-j-pp " Apply the .B OCaml function .I of type (string -> string) to the input of each *_of_string function generated by atdgen (JSON mode). (This was intended for UTF-8 validation of the input which is not performed by atdgen.) .\" ===================== -j-defaults ======================================= .TP .B "-j-defaults" Output .B JSON record fields even if their value is known to be the default. .\" ===================== -j-strict-fields ================================== .TP .B "-j-strict-fields" Call .I !Ag_util.Json.unknown_field_handler for every unknown .B JSON field found in the input instead of simply skipping them. The initial value of this reference prints a message and raises a .I Failure exception. .\" ===================== -j-custom-fields FUNCTION ========================== .TP .B "-j-custom-fields " Call function .I of type (string -> unit) for every unknown .B JSON field found in the input instead of simply skipping them. See also .I -j-strict-fields\fR. .\" ===================== -validate ========================================= .TP .B "-validate" [deprecated] same as .I -t -v\fR, Produce data validators from annotations where x is a user-written validator to be applied on a specific node. This is typically used in conjunction with .I -extend because user-written validators depend on the type definitions. .\" ===================== -extend MODULE ===================================== .TP .B "-extend MODULE" Assume that all type definitions are provided by the specified module unless otherwise annotated. Type aliases are created for each type, e.g. type t = Module.t .\" ===================== -open MODULE1,MODULE2,... ========================== .TP .B "-open MODULE1,MODULE2,..." List of modules to open (comma-separated or space-separated) .\" ===================== -nfd ============================================== .TP .B "-nfd" Do not dump .B OCaml function definitions .\" ===================== -ntd ============================================== .TP .B "-ntd" Do not dump .B OCaml type definitions .\" ===================== -pos-fname FILENAME ================================ .TP .B "-pos-fname FILENAME" Source file name to use for error messages (default: input name) .\" ===================== -pos-lnum LINENUM ================================== .TP .B "-pos-lnum LINENUM" Source line number of the first line of the input (default: 1) .\" ===================== -rec ============================================== .TP .B "-rec" Keep .B OCaml type definitions mutually recursive .\" ===================== -version ========================================== .TP .B "-version" print version and exit .\" ===================== -help ================================================= .TP .B "-help | --help" Display this list of options .\" .\" ========================================================================== .\" ================ SEE ALSO ================================================ .\" ========================================================================== .\" .SH SEE ALSO .TP The \fBAtdgen\fR reference manual, \fI/usr/share/doc/libatdgen-ocaml-dev/atdgen-manual.{html,pdf}\fR .TP The \fBAtdgen\fR tutorial on the \fBAtdgen\fR website, \fIhttp://mjambon.com/atdgen\fR .\" .\" ========================================================================== .\" ================ Author ================================================== .\" ========================================================================== .\" .SH AUTHOR This manual page was written by Sylvain Le Gall and Hendrik Tews , specifically for the Debian project (and may be used by others).