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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1F837BBAF for ; Wed, 4 Feb 2009 14:58:15 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvkCAPItiUmGnQCBh2dsb2JhbACULwEBAQoLCAcTu0GEFgY X-IronPort-AV: E=Sophos;i="4.37,379,1231110000"; d="scan'208";a="22483311" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Feb 2009 14:58:14 +0100 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n14DwDN7091090 for ; Wed, 4 Feb 2009 14:58:14 +0100 (CET) X-Ids:165 Received: from hydrogene.pps.jussieu.fr (localhost.localdomain [127.0.0.1]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id n14DwCUE031909 for ; Wed, 4 Feb 2009 14:58:12 +0100 Received: (from abate@localhost) by hydrogene.pps.jussieu.fr (8.13.4/8.13.2/Submit) id n14DwCMv031908 for caml-list@yquem.inria.fr; Wed, 4 Feb 2009 14:58:12 +0100 Date: Wed, 4 Feb 2009 14:58:12 +0100 From: Pietro Abate To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Limiting scope of grammar extension Message-ID: <20090204135812.GB31366@uranium.pps.jussieu.fr> References: <2EB36A07AAE8C44BBB1986425E7A22D0034D5BEF34@atp-mbx1.in.nicta.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D0034D5BEF34@atp-mbx1.in.nicta.com.au> X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.9i X-Virus-Scanned: ClamAV 0.94.2/8950/Wed Feb 4 12:19:05 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail2.jussieu.fr with ID 49899EF5.002 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 49899EF5.002/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ X-j-chkmail-Score: MSGID : 49899EF5.002 on jchkmail2.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.063 -> S=0.063 X-j-chkmail-Status: Ham X-Spam: no; 0.00; steckler:01 camlp:01 ocaml:01 syntax:01 2009:98 wrote:01 pps:01 caml-list:01 jussieu:01 grammar:02 grammar:02 transformed:02 scope:04 extension:06 extension:06 On Wed, Feb 04, 2009 at 02:54:53PM +1100, Paul Steckler wrote: > I have a camlp4 grammar extension that I want to apply to some parts > of a .ml file, but not others. Most of the file uses normal OCaml > syntax. > > Is there a way to mark the parts that I want transformed according > to the grammar extension, while the other parts are left alone? A very simple way might be to use simple delimiters like << my_stm >> and write you extension to expand only statements within these delimiters. This will effectly leave everything else alone... I think. :) p