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=2.3 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 04565BBC4 for ; Thu, 2 Apr 2009 22:23:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYCAIS71EnRVYC9nGdsb2JhbACVXz8BAQEBAQgLCAkRp2aBCJAnAQMBA4N5Bg X-IronPort-AV: E=Sophos;i="4.39,315,1235948400"; d="scan'208";a="37752415" Received: from fk-out-0910.google.com ([209.85.128.189]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Apr 2009 22:23:24 +0200 Received: by fk-out-0910.google.com with SMTP id b27so333242fka.11 for ; Thu, 02 Apr 2009 13:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pngkgjcKq5JUZQ11GRGcOc5EsWRnHdPvJtc5TrfTQj0=; b=tdjhMOwS1jkwLn++VyqKtIC1UrcVhVAwxKpDdVmiB425X5LqLWdn4Lr6RuY4TF8WUS qvWerGWX12kuozVo5KaLaKsy5HNiZyovGijMNYRkdHk//hCKPBlvFgpLSKovQG0wraOr NZ4a+dxKayNjyzn3SAQ3qMpwmuR1qVOnMSN/w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=qDLcYlvAn2ursR9tORQ8j33Rv9ZEX8xBVgodP2HxDGY2atKd6qjhG5ifdwS+3enIZd bCBL6TTWryhkZO1NqXZ82cWlq5TNnLor6/QDiz2eJ4J8DTanly7mWLRX7CaRjfXooXSo eAhdyLidncZUOBRI+kiMZ9nEkZz3G/9aHp3Us= MIME-Version: 1.0 Received: by 10.103.179.1 with SMTP id g1mr202097mup.48.1238703804196; Thu, 02 Apr 2009 13:23:24 -0700 (PDT) In-Reply-To: <49D4B6DB.2020407@users.sourceforge.net> References: <49D4B6DB.2020407@users.sourceforge.net> Date: Thu, 2 Apr 2009 21:23:24 +0100 Message-ID: Subject: Re: How to achieve this camlp4 syntax extension From: Conglun Yao To: Zheng Li Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; camlp:01 syntax:01 syntax:01 'list':01 longident:01 2009:98 2009:98 sourceforge:01 parsed:01 wrote:01 wrote:01 pps:01 jussieu:01 expression:02 defined:02 Nice code!!! Thank you very much. I'm trying to get the Module name, then used in my syntax extension. ModuleName.[ my extension ] It's really a great idea to perform checking in the rule definition. Conglun On Thu, Apr 2, 2009 at 2:00 PM, Zheng Li w= rote: > On 4/2/2009 1:42 PM, Conglun Yao wrote: >> >> Different kinds of error happened, when trying to use it. >> >> Even the ordinary expression: =A0List.length [1; 2;3 ], =A0failed. =A0'L= ist' >> is parsed as module_longident, try to match the rule I defined. >> >> Thanks for any help. >> >> Conglun > > You may have a look at the source code of my pa_scope [1]. It deals with > these issues and support both open scope (via @) and closed scope (via .{= }, > .[], .()). The code is just ~50 lines. > > HTH. > > [1] http://www.pps.jussieu.fr/~li/software/index.html#pa_scope > > -- > Zheng > > > > > > >