English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Ampersand in camlp4 grammar extension
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-29 (09:18)
Subject: RE: [Caml-list] Ampersand in camlp4 grammar extension
Excerpts from Paul Steckler's message of Thu Jan 29 05:36:44 +0100 2009:
> Hi Nicolas,
> > However I can guess in your question that you don't really want to change the
> syntax of the binary operator "&", but rather to change it's meaning. In
> camlp4 there is a much more sane and easier way to do this using filters.
> By the way there is an example in the camlp4 sources that does exactly this.
> Yes, this seems to work -- but it would be simpler, in fact, if I could just use
> a rule in my grammar extension.

> Do you know if there's a way to debug grammar extensions?

I don't think there is a nice way do to it.

> Maybe I need to
> DELETE a rule from the original grammar, though it's not clear to me which
> rule that is.

Look at Camlp4Parsers/Camlp4OCamlRevisedParser.ml

The rule is:
[ [ x = [ "&" | "&&" ] -> <:expr< $lid:x$ >> ] ]

Nicolas Pouillard