English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Parsing simple type expressions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-06 (18:19)
From: Jake Donham <jake@d...>
Subject: Re: [Caml-list] Parsing simple type expressions
On Tue, Jan 6, 2009 at 6:03 AM, Paolo Donadeo <p.donadeo@gmail.com> wrote:

> For a serializer I'm writing I need to parse simple OCaml type
> expressions composed by OCaml basic types, tuples, options and lists.

This is pretty easy with Camlp4, although as you say there isn't much in the
docs to point the way. You might take a look at how orpc does it--see the
parse_type function in


(I'm going to cover using Camlp4 in this way on the blog I posted yesterday,
but not for another week or two.)

You might also look at some other Camlp4-based serialization tools, like
bin-prot/type-conv at