Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] [ANN] New release of Menhir

21 views
Skip to first unread message

Francois Pottier

unread,
Sep 9, 2008, 3:52:49 AM9/9/08
to menhi...@yquem.inria.fr, Caml Mailing List

Hello all,

It is my pleasure to announce a new release of Menhir, with the following
main improvements over previous versions:

--table Menhir now supports producing table-based LR automata, in
the tradition of yacc, bison, and ocamlyacc. This makes
the generated parsers up to 5x smaller, and somewhat slower.

--interpret Menhir can now be used not just as a compiler, but also as
an interpreter. It will read sentences off the standard
input channel, parse them as per your grammar, and report
an outcome. This should help debug grammars.

These new features were implemented by Guillaume Bau, Raja Boujbel, and
François Pottier. We would like to gratefully acknowledge the generous support
of Jane Street Capital LLC, who funded this endeavor through an ocaml summer
project.

As usual, the new release is available either through GODI, or as source code
at the following URL.

http://cristal.inria.fr/~fpottier/menhir/

Enjoy! Comments and bug reports are welcome.

--
François Pottier
Francois...@inria.fr
http://cristal.inria.fr/~fpottier/

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Francois Pottier

unread,
Sep 9, 2008, 4:17:08 AM9/9/08
to Julia Lawall, Caml Mailing List, menhi...@yquem.inria.fr

Dear Julia,

On Tue, Sep 09, 2008 at 10:09:55AM +0200, Julia Lawall wrote:

> I was very excited about this option, because it drops the size of the
> generated code for my parser from 61K LOC to 28K LOC. But unfortunately
> it gives me:
>
> Unbound module MenhirLib.TableInterpreter.Make
>
> when I try to compile.

Yup. I didn't write the details in the announcement; maybe I should have.

When a parser is produced using --table, it is not quite stand-alone: it
must be linked with a new library, called MenhirLib. (This is analogous
to ocaml's Parsing module, which is part of the standard library.)

If you are using ocamlfind, this is quite easy: just add "-package menhirLib"
to your ocamlc/ocamlopt flags (for compiling and for linking), and add
"-linkpkg" to your ocamlc/ocamlopt flags (for linking).

If you do not wish to rely on ocamlfind, then things become slightly more
complicated, since you must tell ocamlc/ocamlopt where MenhirLib is installed.
Fortunately, Menhir itself can help you: it has three new command-line
switches, of the form --suggest-*, which cause it to print suggested flags.
The details are in Menhir's reference manual. The sample Makefile
(demos/Makefile.shared) offers an illustration.

Hope this helps,

0 new messages