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

[Caml-list] Parametrizing ocamlyacc

45 views
Skip to first unread message

Andrej Bauer

unread,
Nov 12, 2008, 9:30:32 AM11/12/08
to caml...@inria.fr
I have the following situation:

- a signature S
- two modules A and B, which both implement S
- an ocamlyacc file which refers to an implementation of S

I want to generate two executable, one where A is used and another
where B is used.

The most logical thing would be to turn the ocamlyacc part into a
functor which accepts an implementation of S. But there does not seem
to be any way of doing this. What can I do?

Can menhir do this?

Best regards,

Andrej

_______________________________________________
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,
Nov 12, 2008, 10:35:31 AM11/12/08
to Andrej Bauer, caml...@inria.fr

On Wed, Nov 12, 2008 at 03:30:22PM +0100, Andrej Bauer wrote:
> The most logical thing would be to turn the ocamlyacc part into a
> functor which accepts an implementation of S. But there does not seem
> to be any way of doing this. What can I do?
>
> Can menhir do this?

Yes, Menhir has a keyword (%parameter) that allows precisely this.

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

0 new messages