Preprocessor

The camlp5 shell command takes a file as parameter. This file is parsed according to parsing kits. In case of syntax errors, the command fails with an error message.

Parsing kits are compiled ocaml objects. When encountered, they are loaded in camlp5 core. This way, they can change the grammar of the language, by extensions added or deleted, or redefinition of the language grammar from scratch.

There are two ways to specify a parser kit:

The command camlp5 alone does not have any default parsing kit. Its initial grammar is empty and, by default, all source files fail when parsed. The two main parsers kits are:

Two extra commands are provided, "camlp5o" and "camlp5r", which are shortcuts of, respectively:

camlp5 pa_o.cmo
camlp5 pa_r.cmo

Copyright 2007 Daniel de Rauglaudre (INRIA)

Valid XHTML 1.1