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=1.4 required=5.0 tests=DNS_FROM_RFC_POST, HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 6243EBBAF for ; Wed, 22 Jul 2009 14:54:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEIAFyoZkpQDPKWYmdsb2JhbACCJDCXBxcKCQkQBrZdhA4F X-IronPort-AV: E=Sophos;i="4.43,247,1246831200"; d="asc'?scan'208,217";a="43796538" Received: from smtp2f.orange.fr ([80.12.242.150]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Jul 2009 14:54:18 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2f01.orange.fr (SMTP Server) with ESMTP id 00CFA80000B2 for ; Wed, 22 Jul 2009 14:54:18 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2f01.orange.fr (SMTP Server) with ESMTP id E8AE580000B4 for ; Wed, 22 Jul 2009 14:54:17 +0200 (CEST) Received: from [192.168.1.2] (LAubervilliers-153-53-1-14.w217-128.abo.wanadoo.fr [217.128.128.14]) by mwinf2f01.orange.fr (SMTP Server) with ESMTP id B387A80000B2 for ; Wed, 22 Jul 2009 14:54:17 +0200 (CEST) X-ME-UUID: 20090722125417735.B387A80000B2@mwinf2f01.orange.fr Subject: Re: [Caml-list] DELETE_RULE arguments? From: Serge Leblanc To: caml-list@yquem.inria.fr In-Reply-To: <527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com> References: <1248006890.4590.166.camel@serge2> <1248215743.6357.39.camel@serge2> <527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-5KZRVEY17Tj0xN3Yn09b" Date: Wed, 22 Jul 2009 14:54:16 +0200 Message-Id: <1248267256.4403.13.camel@serge2> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-Spam: no; 0.00; lident:01 lident:01 camlp:01 foo:01 foo:01 0200,:01 camlp:01 'foo:01 gpg:01 3324:01 gpg:01 3324:01 0200,:01 'foo:01 2009:98 X-Attachments: cset="utf-8" type="application/pgp-signature" name="signature.asc" --=-5KZRVEY17Tj0xN3Yn09b Content-Type: multipart/alternative; boundary="=-2mVs5vUNOOuSHf8BRIdW" --=-2mVs5vUNOOuSHf8BRIdW Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Unfortunately with ( `_ LIDENT) the statement is also split into " LIDENT _" in pattern matching: $ camlp4of -str 'DELETE_RULE Gram bar: "foo"; (`LIDENT _); bar END' Gram.delete_rule bar [ Gram.Skeyword "foo"; Gram.Stoken (((function | LIDENT _ -> true | _ -> false), "LIDENT _")); Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ] On Wed, 2009-07-22 at 09:26 +0200, blue storm wrote:=20 > That was the correct code, except you shouldn't have tested it in the she= ll : >=20 > $ 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)) ] >=20 > You can have the exact "LIDENT _" output with (`LIDENT _), though i'm > not sure it changes the end result. >=20 > On Wed, Jul 22, 2009 at 12:35 AM, Serge Leblanc = wrote: > > 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 > > [ Gram.Snterm (Gram.Entry.obj (foo : 'foo Gram.Entry.t)); > > Gram.Stoken > > (((function | LIDENT ((_)) -> true | _ -> false), "LIDENT ((_))")= ); > > Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ] > > > > while the running example is the following : > > > > Gram.delete_rule foo > > [ Gram.Skeyword "foo"; > > Gram.Stoken > > (((function | LIDENT ((_)) -> true | _ -> false), "LIDENT _")= ); > > 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 hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1= B > > Fingerprint =3D 066C 005F 5595 D85C 7673 D969 1DD4 90C4 3324 3C1B -- Serge Leblanc gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1B Fingerprint =3D 066C 005F 5595 D85C 7673 D969 1DD4 90C4 3324 3C1B --=-2mVs5vUNOOuSHf8BRIdW Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Unfortunately with ( `_ LIDENT) the statement is also split into " LID= ENT _" in pattern matching:

$ camlp4of -str 'DELETE_RULE Gram bar: "foo"; (`LIDENT _); bar EN= D'
Gram.delete_rule bar
  [ Gram.Skeyword "foo";
    Gram.Stoken (((function | LIDENT _ -> true | _ -> = false), "LIDENT _"));
    Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ]=


On Wed, 2009-07-22 at 09:26 +0200, blue storm wrote:=20
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), "LI=
DENT ((_))"));
    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<serge.leblanc@orange.fr> wrote:
> In the attached exemple, the DELETE_RULE raise an exception Not_found.
> The statement DELETE_RULE Gram foo: "foo"; LIDENT; END bar i=
s exploded as
> follows :
>
> $ camlp4of -str "DELETE_RULE Gram foo: "foo"; LIDENT; b=
ar END"
>
> Gram.delete_rule foo
>   [ Gram.Snterm (Gram.Entry.obj (foo : 'foo Gram.Entry.t));
>     Gram.Stoken
>       (((function | LIDENT ((_)) -> true |=
 _ -> false), "LIDENT ((_))"));
>     Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.=
t)) ]
>
> while the running example is the following :
>
> Gram.delete_rule foo
>       [ Gram.Skeyword "foo";
>         Gram.Stoken
>           (((function | L=
IDENT ((_)) -> true | _ -> false), "LIDENT _"));
>         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  hkp://keyserver.ubuntu.com:11371 --recv-keys 0x3=
3243C1B
> Fingerprint =3D 066C 005F 5595 D85C 7673  D969 1DD4 90C4 3324 3C1=
B

--
Serge Leblanc
gpg --keyserver  hkp://keyserver.ubuntu.com:11= 371 --recv-keys 0x33243C1B
Fingerprint =3D 066C 005F 5595 D85C 7673  D969= 1DD4 90C4 3324 3C1B

--=-2mVs5vUNOOuSHf8BRIdW-- --=-5KZRVEY17Tj0xN3Yn09b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkpnC/EACgkQHdSQxDMkPBspugCeOBCjj5FUrIzS3Ao4sUoajYBm GCEAnRQ+zQO52G+UASA/fEQJg7uVdo26 =8iXI -----END PGP SIGNATURE----- --=-5KZRVEY17Tj0xN3Yn09b--