Camlp4
version 1.07.2
Daniel de Rauglaudre
May 4, 1998
Copyright © 1998 Institut National de Recherche en Informatique et Automatique
Contents
Introduction
Camlp4
Camlp4 predefined files
Preprocessing Objective Caml
The compiler
Remark
The toplevel
User syntax modifications
Quotations
Syntax
Creating a quotation expander
Errors
Exception raised in an expander
Error while parsing the expander result (string expanders)
Typing error
Predefined quotation expanders
Some examples
Defining constants
Lambda Calculus
Grammars
Grammars and entries
Extension
Syntax of a position
Syntax of an extension
Syntax of a level-rules
Language parsed
Deletion
Examples
Arithmetic calculator
Camlp4 bootstrap
Syntax extensions
The abstract syntax tree
Extending the language
Examples of language extensions
Infix
Repeat until à la Pascal
Redefining the whole syntax
The Righteous syntax
Phrases
Imperative constructions
T-uples and lists
Irrefutable patterns
Constructions with matching
Mutables and assignment
Types
Modules
Objects
Miscellaneous
Streams and parsers
Camlp4 library modules
Module
MLast
: abstract syntax tree
Module
Grammar
: extensible grammars
Clearing grammars and entries
Functions called by statements EXTEND and DELETE RULE
Functorial interface
Module
Pcaml
: language grammar, entries and printers.
Module
Plexer
: lexical analyzer
Module
Quotation
: quotation operations
Module
Stdpp
: standard definitions
Module
Token
: tokens for grammars
Quotations for creating abstract syntax trees
General rules
Quotation
expr
Quotation
patt
Quotation
ctyp
Quotation
sig_item
Quotation
str_item
Quotation
module_type
Quotation
module_expr
About this document ...
Daniel de Rauglaudre
5/4/1998