Camlp4 0.6

From: Daniel de Rauglaudre (
Date: Mon May 12 1997 - 12:24:56 MET DST

From: Daniel de Rauglaudre <>
Message-Id: <>
Subject: Camlp4 0.6
Date: Mon, 12 May 1997 12:24:56 +0200 (MET DST)

A new release of Camlp4 is available. Its version number is 0.6
and is compatible with Ocaml version 1.05.

Available by ftp at

  camlp4.tar.gz the sources the doc

The changes are displayed at the end of this message.


 Projet Cristal - INRIA Rocquencourt
 Tel: +33 (01) 39 63 53 51

Changes from 0.5 to 0.6:

--- Installing

* To compile camlp4, it is no more necessary to have the sources of the
  Objective Caml compiler available. It can be compiled like any other
  Objective Caml program.

--- Options of "camlp4"

* Added option -where: "camlp4 -where" prints the name of the standard
  library directory of Camlp4 and exit. So, the ocaml toplevel and the
  compiler can use the option:
        -I `camlp4 -where`

* Added option -nolib to not search for objects files in the installed
  library directory of Camlp4.

--- Interface of grammar library modules

* The function Grammar.keywords returns now a list of pairs. The pair is
  composed of a keyword and the number of times it is used in entries.

* Changed interface of Token and Grammar for lexers, so user lexers have
  to be changed.

--- New features in grammars

* New instruction "DELETE_RULE" provided by pa_extend.cmo to delete rules.
     DELETE_RULE Pcaml.expr: "if" END;
  deletes the "if" instruction of the language.

* Added the ability to parse some specific integer in grammars: a possible
  parameter to INT, like the ones for LIDENT and UIDENT.

* In instruction EXTEND, ability to omit "-> action", default is "-> ()"

* Ability to add antiquotation (between $'s) as symbol rule, of type string,
  interpreted as a keyword, in instruction EXTEND.

* Ability to put entries with qualified names ( in instruction EXTEND.

--- Quotations

* The module Ast has been renamed MLast. The quotation expander "q_ast.cmo"
  has been renamed "q_MLast.cmo".

* Quotation expanders are now of two kinds:
  - The "classical" type for expanders returning a string. These expanders
    have now a supplementary parameter: a boolean value set to "True"
    when the quotation is in a context of an expression an to "False"
    when the quotation is in a context of a pattern. These expanders,
    returning strings which are parsed afterwards, may work for some
    language syntax and/or language extensions used (e.g. may work for
    Righteous syntax and not for Ocaml syntax).
  - A new type of expander returning directly syntax trees. A pair
    of functions, for expressions and for patterns must be provided.
    These expanders are independant from the language syntax and/or
    extensions used.

* The predefined quotation expanders "ctyp_", "patt_" and "expr_" has
  been deleted; one can use "ctyp", "patt", and "expr" in position of
  pattern or expression.

--- Ocaml and Righteous syntaxes

* Fixed bug: "open Foo.Bar" was converted (pr_dump.cmo) into "open Bar.Foo"

* Corrected behavior different from Ocaml's: "^" and "@" were at the same
  level than "=": now, like Ocaml, they have a separated right associative

--- Grammars behavior

* While extending entries: default position is now "extension of the
  first level", instead of "adding a new level at the end".

* Another Change: in each precedence level, terminals are inserted before
  other symbols (non terminals, lists, options, etc), LIDENT "foo" before
  LIDENT (alone) and UIDENT "foo" before UIDENT (alone). New rules not
  factorizable are now inserted before the other rules.

* Changed algorithm of entries parsing: each precedence level is tested
  against the stream *before* its next precedences levels (instead of
       EXTEND e: [[ LIDENT "a" -> "xxx" ] | [ i = LIDENT -> i ]]; END;
  Now, parsing the entry e with the string "a" returns "xxx" instead of "a"

* Less keywords in instruction EXTEND (LEFTA, LIDENT, etc), which can be
  used now as normal identifiers.

* When inserting a new rule, a warning appears if a rule with the
  same production already existed (it is deleted).

* Parse error messages (Gstream.Error) are formatted => spaces trigger
  Format.print_space and newlines trigger Format.force_newline.

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:10 MET