caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: blue storm <bluestorm.dylc@gmail.com>
To: Serge Leblanc <serge.leblanc@orange.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] DELETE_RULE arguments?
Date: Wed, 22 Jul 2009 09:26:12 +0200	[thread overview]
Message-ID: <527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com> (raw)
In-Reply-To: <1248215743.6357.39.camel@serge2>

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<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 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 0x33243C1B
> Fingerprint = 066C 005F 5595 D85C 7673  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
>
>


  reply	other threads:[~2009-07-22  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 12:34 Serge Leblanc
2009-07-21 22:35 ` [Caml-list] " Serge Leblanc
2009-07-22  7:26   ` blue storm [this message]
2009-07-22 12:54     ` Serge Leblanc
2009-07-22 10:03 ` blue storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com \
    --to=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=serge.leblanc@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).