[ANN] New release of Menhir (20201201)

Dear Menhir & OCaml users,

I would like to announce a new release of Menhir, the LR(1) parser generator
for OCaml. The most prominent new features are intended to improve the comfort
of the machinery that allows producing custom syntax error messages: a demo of
this machinery has been added, new library functions have been added so as to
make it easier to use, and the commands that deal with .messages files have
been improved. An excerpt of the changelog appears below.

opam update
opam upgrade menhir

Happy parsing!

François Pottier
francois.pottier@inria.fr
http://cambium.inria.fr/~fpottier/

2020/12/01

  • The module MenhirLib.ErrorReports is extended with new functions:
    wrap_supplier, extract, sanitize, compress, shorten, expand.

  • The new module MenhirLib.LexerUtil offers a few functions that help
    reading a file, setting up a lexing buffer, printing source code positions,
    etc.

  • The new demo calc-syntax-errors demonstrates how to produce customized
    syntax error messages.

  • The new command --merge-errors merges two .messages files. It can be
    useful when two or more users have independently produced partial
    .messages files and wish to combine their work.
    (Suggested by Gabriel Scherer and François Bobot.)

  • The commands that read .messages files have been hardened so as to
    tolerate situations where a sentence mentions a nonexistent symbol or does
    not lead to an error state. When such a sentence is encountered, an error
    message is produced on the standard error channel; then, this sentence is
    ignored and processing continues. (As an exception, the command
    --compile-errors refuses to proceed in the presence of such sentences.)

2020/11/22

  • The new command line switch --dump-resolved writes a description of the
    automaton to the file .automaton.resolved after all conflicts have been
    resolved and after extra reductions have been introduced. This file also
    shows which states have a default reduction.

  • The command line switch --dump writes a description of the automaton to
    the file .automaton after benign conflicts have been silently resolved,
    but before severe conflicts are resolved and before extra reductions are
    introduced. (This behavior is unchanged.) The manner in which end-of-stream
    conflicts are displayed in this file has been improved.

  • In the files .automaton and .automaton.resolved, the reduction table in
    each state is now presented in a much more compact and readable way.

  • In the files .automaton and .automaton.resolved, the known suffix of the
    stack in each state is now explicitly shown. (Although it can be deduced
    from the LR(1) items, showing it helps.)

  • Document the problem caused by placing a module alias declaration
    in an .mly file. (See Questions and Answers in the manual.)

  • Turn off a costly internal well-formedness assertion.
    This allows a 30% speedup in the construction of large automata
    and in the conflict explanation process. (Reported by Joe.)

2 Likes