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.1 required=5.0 tests=AWL,DNS_FROM_RFC_POST, 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 3460ABBAF for ; Wed, 22 Jul 2009 09:26:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8CAG9bZkrRVdramGdsb2JhbACPBooZPwEBAQEBCAkMBxOlS4EbkFwBAwIEhAoF X-IronPort-AV: E=Sophos;i="4.43,245,1246831200"; d="scan'208";a="33404151" Received: from mail-bw0-f218.google.com ([209.85.218.218]) by mail1-smtp-roc.national.inria.fr with ESMTP; 22 Jul 2009 09:26:12 +0200 Received: by bwz18 with SMTP id 18so2466bwz.27 for ; Wed, 22 Jul 2009 00:26:12 -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=/Ye3RxJgHLt39u5/XLGRy9eNVLlc2I4R3CkEBa+IkEc=; b=CHocAD1NuDB7S1EPuOYY9Jg99dRM24DHDwaexkVweLRf2CtZIGlqez2kX5dobAEWau HCDaUUxKwGtU+XFTon0bFbJ51+rkixv1je2BVjnTHe+64K1zuJdn3f8Ep4QSf6uHtV++ p8RS1OmbRSdFJmuCe7ZdBRhlq9b47vHD+E7Lw= 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=v6nfuuq+XKdGXGqnnqm95necX1dsntRlL04rdi7lYT19BE+2vf/y0jIYzviAKVIZPO WrcfCrCiVm2HEZvHEqKyoyGj6SJ0+5hZfN3P6DY5UH8bXF+Fu/UqaFoyUUODFRU87Ymc kaTimD683pMseiXNHyOoi4OOX5l8Yfk5IFv5M= MIME-Version: 1.0 Received: by 10.204.52.136 with SMTP id i8mr549927bkg.160.1248247572360; Wed, 22 Jul 2009 00:26:12 -0700 (PDT) In-Reply-To: <1248215743.6357.39.camel@serge2> References: <1248006890.4590.166.camel@serge2> <1248215743.6357.39.camel@serge2> Date: Wed, 22 Jul 2009 09:26:12 +0200 Message-ID: <527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com> Subject: Re: [Caml-list] DELETE_RULE arguments? From: blue storm To: Serge Leblanc 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 foo:01 lident:01 foo:01 lident:01 camlp:01 'foo:01 gpg:01 3324:01 beginner's:01 ocaml:01 bug:01 storm:98 2009:98 exploded:98 That was the correct code, except you shouldn't have tested it in the shell= : $ camlp4of -str "DELETE_RULE Gram bar: \"foo\"; LIDENT; bar END" Gram.delete_rule bar [ Gram.Skeyword "foo"; Gram.Stoken (((fun | LIDENT ((_)) -> true | _ -> false), "LIDENT ((_))"= )); Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ] You can have the exact "LIDENT _" output with (`LIDENT _), though i'm not sure it changes the end result. On Wed, Jul 22, 2009 at 12:35 AM, Serge Leblanc wr= ote: > In the attached exemple, the DELETE_RULE raise an exception Not_found. > The statement DELETE_RULE Gram foo: "foo"; LIDENT; END bar is exploded as > follows : > > $ camlp4of -str "DELETE_RULE Gram foo: "foo"; LIDENT; bar END" > > Gram.delete_rule foo > =A0 [ Gram.Snterm (Gram.Entry.obj (foo : 'foo Gram.Entry.t)); > =A0=A0=A0 Gram.Stoken > =A0=A0=A0=A0=A0 (((function | LIDENT ((_)) -> true | _ -> false), "LIDENT= ((_))")); > =A0=A0=A0 Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ] > > while the running example is the following : > > Gram.delete_rule foo > =A0=A0=A0=A0=A0 [ Gram.Skeyword "foo"; > =A0=A0=A0=A0=A0=A0=A0 Gram.Stoken > =A0=A0=A0=A0=A0=A0=A0=A0=A0 (((function | LIDENT ((_)) -> true | _ -> fal= se), "LIDENT _")); > =A0=A0=A0=A0=A0=A0=A0 Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.= t)) ] > > How do I write the rule DELETE_RULE to work in this case? > -- > Serge Leblanc > gpg --keyserver=A0 hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1= B > Fingerprint =3D 066C 005F 5595 D85C 7673=A0 D969 1DD4 90C4 3324 3C1B > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >