Version française
Home     About     Download     Resources     Contact us    
Browse thread
[ANN] New release of Menhir
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: [Menhir-list] [ANN] New release of Menhir

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,

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