camlp4o

CAMLP4(1)                   General Commands Manual                  CAMLP4(1)



NAME
       camlp4 - Pre-Precessor-Pretty-Printer for Objective Caml
       mkcamlp4 - Create custom camlp4
       ocpp - Universal preprocessor


SYNOPSIS
       camlp4 [ load-options ] [ other-options ]
       camlp4o [ load-options ] [ other-options ]
       camlp4r [ load-options ] [ other-options ]
       camlp4o.opt [ other-options ]
       camlp4r.opt [ other-options ]
       camlp4o.cma
       camlp4r.cma
       mkcamlp4
       ocpp [ load-options ] file


DESCRIPTION
       camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml, parsing a
       source file and printing some result on standard output.

       mkcamlp4 creates camlp4 executables with almost the same options than
       ocamlmktop.  See further.

       ocpp is an universal preprocessor, treating any kind of source file,
       generating the same text with the possible quotations expanded.

       Both camlp4 and ocpp are programmable in Objective Caml.


LOAD OPTIONS
       The load options select parsing and printing actions recorded in
       Objective Caml object files (ending with .cmo or .cma). Several usage
       of these options are authorized. They must precede the other options.
       An optionnal -- may end the load options.


       -I directory
              Add directory in the search path for files loaded. Unless the
              option -nolib is used, the camlp4's library directory is
              appended to the path. Warning: there is no automatic search in
              the current directory: add "-I ." for this.

       -where Print camlp4's library directory name and exit.

       -nolib No automatic search for objects files in camlp4's library
              directory.

       object-file
              The file is loaded in camlp4's core.


OTHER OPTIONS
       The others options are:


       file   Treat file as an interface file if it ends with .mli and as an
              implementation file if it ends with .ml.


       -intf file
              Treat file as an interface file, whatever its extension.

       -impl file
              Treat file as an implementation file, whatever its extension.

       -unsafe
              Generate unsafe accesses to arrays and strings.

       -noassert
              Do not compile assertion checks.

       -QD file
              Dump in file in case of syntax error in the result of a
              quotation expansion.

       -o out-file
              Print the result on out-file instead of standard output. File is
              opened with open_out_bin (see Ocaml library Pervasives).

       -v     Print the version number and exit.

       -help  Print the available options and exit. This print includes the
              options possibly added by the loaded object files.


       The others options can be extended by loaded object files. The provided
       files add the following options:


       -l line-length
              Added by pr_o.cmo and pr_r.cmo: set the line length (default
              78).

       -sep string
              Added by pr_o.cmo and pr_r.cmo: print this string between
              phrases instead of comments.

       -no_ss Added by pr_o.cmo: do not print double semicolons

       -D ident
              Added by pa_ifdef.cmo: define the ident.

       -U ident
              Added by pa_ifdef.cmo: undefine the ident.


PROVIDED FILES
       These files are installed in the directory /usr/local/lib/camlp4.


       Parsing files:
           pa_o.cmo: syntax of Objective Caml
           pa_op.cmo: streams and parsers
           pa_oop.cmo: streams and parsers (without code optimization)
           pa_r.cmo: revised syntax
           pa_rp.cmo: streams and parsers
           pa_extend.cmo: syntax extension for grammars
           pa_ifdef.cmo: add ifdef instruction (conditional compilation)
           pa_olabl.cmo: old syntax for labels

       Printing files:
           pr_o.cmo: syntax of Objective Caml
           pr_op.cmo: try to rebuild streams and parsers syntax
           pr_r.cmo: revised syntax
           pr_rp.cmo: try to rebuild streams and parsers syntax
           pr_extend.cmo: try to rebuild EXTEND instructions
           pr_dump.cmo: syntax tree
           pr_depend.cmo: file dependencies
           pr_null.cmo: no output

       Quotation expanders:
           q_MLast.cmo: syntax tree nodes
           q_phony.cmo: keeping quotations for pretty printing

       The command camlp4o is a shortcut for:
           camlp4 pa_o.cmo pa_op.cmo pr_dump.cmo

       The command camlp4r is a shortcut for:
           camlp4 pa_r.cmo pa_rp.cmo pr_dump.cmo

       The command camlp4o.opt (if installed) is a native-code version of
       camlp4o. It is faster than camlp4o but not extensible.

       The command camlp4r.opt (if installed) is a native-code version of
       camlp4r linked in advance with pa_extend (syntax for grammar
       extensions), q_MLast (quotations for syntax tree nodes) and pa_ifdef
       (ifdef statement).

       The file camlp4o.cma can be loaded in the toplevel to start camlp4 with
       Objective Caml syntax.

       The file camlp4r.cma can be loaded in the toplevel to start camlp4 with
       revised syntax.


MKCAMLP4
       Mkcamlp4 creates camlp4 executables with almost the same options than
       ocamlmktop.  The only difference is that the interfaces to be visible
       must be explicitly added in the command line as ".cmi" files. For
       example, how to add the the Objective Caml module "str":
           mkcamlp4 -custom str.cmi str.cma -cclib -lstr \
               -o camlp4str


FILES
       Camlp4's library directory in the present installation:
       /usr/local/lib/camlp4


SEE ALSO
       The documentation of camlp4.
       ocamlc(1), ocaml(1).


AUTHOR
       Daniel de Rauglaudre, INRIA Rocquencourt.



INRIA                                                                CAMLP4(1)