1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2
"http://www.w3.org/TR/REC-html40/loose.dtd">
6
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7
<META name="GENERATOR" content="hevea 1.06">
12
<BODY TEXT=black BGCOLOR=white>
13
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
14
<A HREF="manual002.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
16
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
17
<TR><TD BGCOLOR="#2de52d"><DIV ALIGN=center><TABLE>
18
<TR><TD><B><FONT SIZE=6>Introduction</FONT></B></TD>
19
</TR></TABLE></DIV></TD>
21
Camlp4 is a Pre-Processor-Pretty-Printer for OCaml. It offers
22
syntactic tools (parsers, extensible grammars), the ability to extend
23
the concrete syntax of OCaml (quotations, syntax extensions), and to
24
redefine it from scratch.<BR>
26
This document holds the directions for use of Camlp4 and describes
27
these features. It is written for programmers who already know OCaml,
28
and are interested in concrete syntax.<BR>
30
Here are the contents of the present document:
32
Chapter <A HREF="manual002.html#c:camlp4">1</A>. ``Camlp4'' describes the Camlp4
33
features, the predefined syntaxes offered and how to use Camlp4 with
34
the OCaml compiler and toplevel.
35
<LI>Chapter <A HREF="manual004.html#c:quotations">3</A>. ``Quotations'' describes the Camlp4
36
quotation system, the first and simplest way to make syntax
38
<LI>Chapter <A HREF="manual005.html#c:grammars">4</A>. ``Grammars'' describes the Camlp4
39
grammar system, a way to create grammars, more powerful and convenient
40
than the simple stream parsers, and which are extensible what yacc and
41
lex are not. Camlp4 predefined syntaxes use this grammar
43
<LI>Chapter <A HREF="manual006.html#c:extend">5</A>. ``Syntax extensions'' describes how to
44
make concrete syntax extensions in OCaml and how to create a
45
new concrete syntax for the whole language. A knowledge of the Camlp4
46
grammar system (chapter <A HREF="manual005.html#c:grammars">4</A>) is necessary to read this
48
<LI>Chapter <A HREF="manual007.html#c:revised">6</A>. ``The revised syntax'' describes an
49
alternative concrete syntax for OCaml supposed to fix some
50
difficulties of the standard OCaml concrete syntax. This
51
chapter can be read directly without having read the other ones.
52
<LI>Chapter <A HREF="manual008.html#c:manother">7</A>. ``Other extensions'' describes the
53
extensible functions and the functional streams.
54
<LI>Chapter <A HREF="manual009.html#c:lib">8</A>. ``Camlp4 library modules'' describes the
55
interfaces of the Camlp4 library modules used by the Camlp4 tools:
56
``<CODE>Grammar</CODE>'',
57
``<CODE>Pcaml</CODE>'',
58
``<CODE>Plexer</CODE>'',
59
``<CODE>Stdpp</CODE>'',
60
``<CODE>Token</CODE>''.
61
<LI>Appendix <A HREF="manual010.html#a:q_ast">A</A>. ``Quotation for creating abstract syntax
62
trees'' describes a quotation expander provided to create language
65
The ``4'' in ``Camlp4'' comes from the four ``P'' in its definition
66
``Pre-Processor-Pretty-Printer''.
69
<I><FONT COLOR=maroon>
71
For remarks about Camlp4, write to:
72
<img src="http://cristal.inria.fr/~ddr/images/email.jpg" alt=email align=top>
74
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
75
<A HREF="manual002.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>