/usr/local/lib/camlp4
: in the whole document, this
directory is named camlp4-lib-dir
). The provided files are:pa_o.cmo
: Objective Caml.
pa_r.cmo
: Revised: this is an alternative syntax for the
language (chapter 5).
pr_o.cmo
: Pretty print with Objective Caml syntax. Add an
option -l
to the command line to specify a line length.
pr_r.cmo
: Pretty print with revised syntax. Add this option
-l
too.
pr_dump.cmo
: Dump the syntax tree
pa_oop.cmo
: (to be loaded after ``pa_o.cmo
'')
Parsers and streams, with Objective Caml syntax, without code
optimization, corresponding to what is internally generated by
the Objective Caml compiler.
pa_op.cmo
: (to be loaded after ``pa_o.cmo
'')
Parsers and streams, with Objective Caml syntax, with code optimization.
pa_rp.cmo
: (to be loaded after ``pa_r.cmo
'')
Parsers and streams, with revised syntax and code optimization.
pa_extend.cmo
: (to be loaded either after
``pa_o.cmo
'' or ``pa_r.cmo
'') Syntax extensions for the
Camlp4 grammar system (Chapter 3).
pa_ifdef.cmo
: add ifdef
statement like in C
(conditional compilation), in expressions or structure items. Add
the options -D
and -U
to the camlp4 command line. To
define the symbol FOO
, either use ``-DFOO
'' in the
camlp4 command line, e.g.:
camlp4o pa_ifdef.cmo -DFOO file.mlor make a file, e.g. ``
foo.ml
'', holding
Pa_ifdef.define "FOO";;compile it and load its corresponding object file:
camlp4o pa_ifdef.cmo ./foo.cmo file.mlTo undefine the symbol
FOO
, use either ``-UFOO
'' or
the function ``Pa_ifdef.undef
''. The statement
``ifdef
'' can be used in a place of a struture item or an expression:
in this last case, ``else
'' is required:
ifdef FOO then type t = A of int;; let f x = ifdef FOO then x + 1 else x - 1;;
pa_ru.cmo
: (to be loaded after ``pa_r.cmo
'' only)
Add type constraints of type unit
inside sequences.
pr_op.cmo
:
Try to rebuilt parsers and streams in Objective Caml syntax.
pr_rp.cmo
: Try to rebuilt parsers and streams in revised syntax.
pr_extend.cmo
: Try to rebuilt EXTEND instructions.
pr_depend.cmo
: Print file dependencies.
camlp4o
'' is equivalent to:
camlp4 pa_o.cmo pa_op.cmo pr_dump.cmo
camlp4r
'' is equivalent to:
camlp4 pa_r.cmo pa_rp.cmo pr_dump.cmo