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
MenhirLib.ErrorReportsis extended with new functions:
The new module
MenhirLib.LexerUtiloffers a few functions that help
reading a file, setting up a lexing buffer, printing source code positions,
The new demo
calc-syntax-errorsdemonstrates how to produce customized
syntax error messages.
The new command
.messagesfiles. It can be
useful when two or more users have independently produced partial
.messagesfiles and wish to combine their work.
(Suggested by Gabriel Scherer and François Bobot.)
The commands that read
.messagesfiles 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-errorsrefuses to proceed in the presence of such sentences.)
The new command line switch
--dump-resolvedwrites a description of the
automaton to the file
.automaton.resolvedafter 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
--dumpwrites a description of the automaton to
.automatonafter 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.resolved, the reduction table in
each state is now presented in a much more compact and readable way.
In the files
.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
.mlyfile. (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.)