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=NO_RELAYS autolearn=disabled version=3.1.3 Received: by yquem.inria.fr (Postfix, from userid 25991) id CB716BC69; Sun, 19 Aug 2007 20:16:34 +0200 (CEST) Date: Sun, 19 Aug 2007 20:16:34 +0200 From: Daniel de Rauglaudre To: Caml mailing list Subject: Re: [Caml-list] How can I generate an AST? Message-ID: <20070819181634.GA797@yquem.inria.fr> References: <6f9f8f4a0708191039o2119f94bm10959175cc887eef@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f9f8f4a0708191039o2119f94bm10959175cc887eef@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Spam: no; 0.00; rauglaudre:01 rauglaudre:01 0200,:01 syntax:01 ocaml:01 syntax:01 camlp:01 camlp:01 parser:01 wrote:01 parsing:01 preprocessor:01 caml-list:01 ast:02 ast:02 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. 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). -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/