From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 94C48BC69 for ; Mon, 24 Dec 2007 17:03:37 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAE5mb0fB/BYfhWdsb2JhbACQDgEBAQgEBgcIEweYBA X-IronPort-AV: E=Sophos;i="4.24,204,1196636400"; d="scan'208";a="5495410" Received: from smtp20.orange.fr ([193.252.22.31]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Dec 2007 17:03:37 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2019.orange.fr (SMTP Server) with ESMTP id E01581C00123 for ; Mon, 24 Dec 2007 17:03:36 +0100 (CET) Received: from [192.168.1.59] (APuteaux-154-1-68-138.w81-249.abo.wanadoo.fr [81.249.51.138]) by mwinf2019.orange.fr (SMTP Server) with ESMTP id A54DC1C000F8; Mon, 24 Dec 2007 17:03:36 +0100 (CET) X-ME-UUID: 20071224160336677.A54DC1C000F8@mwinf2019.orange.fr Message-ID: <476FD855.9010800@frisch.fr> Date: Mon, 24 Dec 2007 17:03:33 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Arnaud Spiwack , Caml mailing list Subject: Re: [Caml-list] OCamlduce + camlp4 References: <476FBA62.9080600@lix.polytechnique.fr> In-Reply-To: <476FBA62.9080600@lix.polytechnique.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 ocamlduce:01 camlp:01 camlp:01 syntax:01 ocamlduce:01 syntax:01 parser:01 ocaml:01 ocaml:01 parsetree:01 parser:01 lexers:01 cduce:01 Arnaud Spiwack wrote: > There I discovered that I couldn't find a camlp4 syntax file for > OCamlduce (to be able to extend OCamlduce's syntax). In my case, I'd > like an equivalent to camlp4orf (original syntax, but revised-syntax > quotations) that handles OCamlduce syntax (though, original-syntax > quotation would require little to change, thus would be all right). > > Does anybody know whether it already exists ? (maybe Alain or Nicolas ;) ). > > If it does not, I shall consider making one myself, but I will have to > know better of the insides of OCamlduce. I'm not aware of a Camlp4 parser for OCamlduce (which probably means that such a thing does not exist). It should not be difficult (only quite boring) to write one. Of course, before writing the grammar, you'll have to extend Camlp4's OCaml syntax tree with new constructions and its translation to the real OCaml AST (Parsetree). The OCamlDuce parser uses different lexers for the OCaml and CDuce parts. This is done by switching lexing mode on a few tokens ( {{, {:, :}, }}). It is possible to reproduce that with Camlp4 (you can plug an arbitrary lexer). Let me know if you need more assistance on the OCamlDuce side... Good luck! -- Alain