20.03.2015 Views

The Objective Caml system release 3.06 - The Caml language - Inria

The Objective Caml system release 3.06 - The Caml language - Inria

The Objective Caml system release 3.06 - The Caml language - Inria

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3<br />

9 <strong>The</strong> toplevel <strong>system</strong> (ocaml) 145<br />

9.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147<br />

9.2 Toplevel directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148<br />

9.3 <strong>The</strong> toplevel and the module <strong>system</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . 149<br />

9.4 Common errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150<br />

9.5 Building custom toplevel <strong>system</strong>s: ocamlmktop . . . . . . . . . . . . . . . . . . . . . 150<br />

9.6 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151<br />

10 <strong>The</strong> runtime <strong>system</strong> (ocamlrun) 153<br />

10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153<br />

10.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154<br />

10.3 Dynamic loading of shared libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . 155<br />

10.4 Common errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156<br />

11 Native-code compilation (ocamlopt) 159<br />

11.1 Overview of the compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159<br />

11.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160<br />

11.3 Common errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164<br />

11.4 Compatibility with the bytecode compiler . . . . . . . . . . . . . . . . . . . . . . . 164<br />

12 Lexer and parser generators (ocamllex, ocamlyacc) 167<br />

12.1 Overview of ocamllex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167<br />

12.2 Syntax of lexer definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168<br />

12.3 Overview of ocamlyacc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />

12.4 Syntax of grammar definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />

12.5 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173<br />

12.6 A complete example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173<br />

12.7 Common errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175<br />

13 Dependency generator (ocamldep) 177<br />

13.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177<br />

13.2 A typical Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178<br />

14 <strong>The</strong> browser/editor (ocamlbrowser) 181<br />

14.1 Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181<br />

14.2 Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182<br />

14.3 Module browsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182<br />

14.4 File editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />

14.5 Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />

15 <strong>The</strong> documentation generator (ocamldoc) 185<br />

15.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185<br />

15.2 Syntax of documentation comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 191<br />

15.3 Custom generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199<br />

15.4 Adding command line options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!