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.9 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 87551BC69 for ; Tue, 23 Oct 2007 12:34:15 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALtqHUfAXQInh2dsb2JhbACOVgIBCAop X-IronPort-AV: E=Sophos;i="4.21,316,1188770400"; d="scan'208";a="3529342" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Oct 2007 12:34:15 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9NAYE75027645 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 23 Oct 2007 12:34:15 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAG9rHUdA6ba7kmdsb2JhbACOVgIBAQcCBik X-IronPort-AV: E=Sophos;i="4.21,316,1188770400"; d="scan'208";a="3505643" Received: from nf-out-0910.google.com ([64.233.182.187]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Oct 2007 12:34:14 +0200 Received: by nf-out-0910.google.com with SMTP id g13so1107534nfb for ; Tue, 23 Oct 2007 03:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; bh=hyhif5JXG7AbuZSWWaSvCe8czmT+w7Re/eGh8nF1KVo=; b=EasldOy32I9uNuzKi/rxaBk2ScRUlrpykR6Sa6t2+d6iIFUp8nsbOMV1QwKJhT10eUalTVv3lhZppETMPW/uJta9UMfxVa1fyLpgi4jD6YCQq52/k0J0TvG+ivIGKy0+jg58WDAhjnH2YW5+rvxBW75BufbqSooKH0brj+KPfto= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=AQYq1wdDQJG9FK5tskWHXgRfpAT1zW8jC3rKa2IM+z8JYsVtxNa+idKhf1qgxTohaj+OHqvMFsm524S39/PYoSkkdBOJrSiUmxCV3zurPqXWqNIhSEYAnaiJrf+u1GO4Z4IDuXCRqmDS7Oll4O22g+N1MhfF8W8+FZFV2I3DpCM= Received: by 10.86.95.20 with SMTP id s20mr4595521fgb.1193135654354; Tue, 23 Oct 2007 03:34:14 -0700 (PDT) Received: from ?192.168.0.1? ( [82.246.197.195]) by mx.google.com with ESMTPS id w7sm14847690mue.2007.10.23.03.34.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Oct 2007 03:34:12 -0700 (PDT) Subject: Re: [Caml-list] Camlp4 as a universal pre-processor ? From: David Teller To: Nicolas Pouillard Cc: caml-list In-Reply-To: <1193131952-sup-5002@ausone.inria.fr> References: <1193118873.7228.10.camel@Blefuscu> <1193131952-sup-5002@ausone.inria.fr> Content-Type: text/plain Date: Tue, 23 Oct 2007 12:34:15 +0200 Message-Id: <1193135655.6327.2.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Sender: David Teller X-Miltered: at concorde with ID 471DCE27.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 univ-orleans:01 lambda:01 syntax:01 ocaml:01 expr:01 lexer:01 parser:01 camlp:01 cheers:01 0200,:01 lexer:01 wiki:01 untyped:01 lambda:01 I've read the Lambda example, but it looked to me like it was a syntax extension for OCaml and no other language, unless I completely misunderstand the meaning of, say, <:expr<...>> . Now, do you suggest I should write a full lexer and parser with Camlp4 just in order to write simple macros ? Cheers, David On Tue, 2007-10-23 at 11:39 +0200, Nicolas Pouillard wrote: > A way to start this is to just keep the lexer and provide a new grammar > including quotations [2] and antiquotations. On the wiki [1] there is also a > small but complete example of a grammar for the untyped lambda calculus with > antiquotations [3], and also a tutorial of making a full parser with Camlp4 [4]. > > [1]: http://brion.inria.fr/gallium/index.php/Camlp4 > [2]: http://brion.inria.fr/gallium/index.php/Quotation > [3]: http://brion.inria.fr/gallium/index.php/Lambda_calculus_quotations > [4]: http://brion.inria.fr/gallium/index.php/Full_parser_tutorial -- David Teller ------------------------------------------ Security of Distributed Systems ----------------------- Project JStify: Static Analysis for JavaScript 2 ----- -- http://www.univ-orleans.fr/lifo/Members/David.Teller ----- Laboratoire d'Informatique Fondamentale d'Orleans