Version française
Home     About     Download     Resources     Contact us    
Browse thread
DELETE_RULE arguments?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: blue storm <bluestorm.dylc@g...>
Subject: Re: [Caml-list] DELETE_RULE arguments?
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
>
>