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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id A181DBC69 for ; Mon, 20 Aug 2007 10:22:19 +0200 (CEST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7K8MIm8006901 for ; Mon, 20 Aug 2007 10:22:19 +0200 Received: by rv-out-0910.google.com with SMTP id k20so962565rvb for ; Mon, 20 Aug 2007 01:22:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UrOH/Tt3yf1Lr04TF9jXffDpPXLf9FMIuIvV3lNmNIzUimL9as+yh6sc6/ABRh8P/6toLXgqd3KogIq9b2YaB+XAvB69t0RBKG5B6AaOovPfJM7uLnd88p4NSobI3RZXOX1Fv8NQpKuySqXhbVyh3YgwdNwdZIO7MQoJVAA+VYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cg9m/h4QwZoskily1n/4ETq9xtxrpOqdU8o53T6eL4llN7SGiQDyHHuaOQPHIoQF0EVqyFGrt7yTKm4nT7mqI25mImvhDoqo1oeW7szRYmQ/snrlcU81ss9WouDPdL1CRct2MbrHt2IvKnBu2yYc4bukbPf/EudAqzzsi9dVezo= Received: by 10.140.165.21 with SMTP id n21mr2527748rve.1187598137388; Mon, 20 Aug 2007 01:22:17 -0700 (PDT) Received: by 10.64.148.3 with HTTP; Mon, 20 Aug 2007 01:22:17 -0700 (PDT) Message-ID: <6f9f8f4a0708200122k710b2f3dnd723a7244140575e@mail.gmail.com> Date: Mon, 20 Aug 2007 10:22:17 +0200 From: "Loup Vaillant" To: "Caml mailing list" Subject: Re: [Caml-list] How can I generate an AST? In-Reply-To: <20070819181634.GA797@yquem.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6f9f8f4a0708191039o2119f94bm10959175cc887eef@mail.gmail.com> <20070819181634.GA797@yquem.inria.fr> X-j-chkmail-Score: MSGID : 46C94F3A.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46C94F3A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; rauglaudre:01 rauglaudre:01 0200,:01 syntax:01 ocaml:01 syntax:01 camlp:01 camlp:01 parser:01 ocaml:01 wrote:01 parsing:01 preprocessor:01 caml-list:01 dependency:01 2007/8/19, Daniel de Rauglaudre : > Hi, > > On Sun, Aug 19, 2007 at 07:39:50PM +0200, Loup Vaillant wrote: > > > I would like to write a preprocessor of my own (to make a lisp > > syntax). In the process, I am slowly catching up with the Ocaml AST. > > If you just need a Lisp syntax, you can use Camlp5 which proposes a > Lisp syntax among its parsing kits: > http://pauillac.inria.fr/~ddr/camlp5/doc/html/scheme.html > > Perhaps (probably) incomplete, but you can complete or fix it if you > want. Looks great, but unfortunately, I think it is unsuitable for what I want to do : a macro system based on a lisp-like syntax. I want reader macros as well as regular ones. (By the way, have I overlooked a "defmacro" in your syntax?) > If you are interested on the fact of *programming* yourself a new > syntax, use Camlp5: make your parser generating Camlp5 AST and the > rest (dumping syntax tree) is already done by Camlp5. See the doc > or ask who knows for hints (me or other). This may be a better approach. However, I am not eager to use camlp*, for it will introduce a additional dependency. I may choose this however, if the camlp* AST is simpler than the Ocaml AST. Where can I find it? Thank you, Loup