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
New Camlp4 questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-07 (09:54)
From: Dmitry Bely <dmitry.bely@g...>
Subject: New Camlp4 questions
Still trying to convert IoXML to the new Camlp4 syntax. What is an
equivalent for

Pcaml.warning.val loc "Warning: IoXML not implemented for this type";


value type_declaration : Grammar.Entry.e 'a =
  Obj.magic (Grammar.Entry.find Pcaml.str_item "type_declaration")

DELETE_RULE Pcaml.str_item: "type"; LIST1 type_declaration SEP "and" END;
DELETE_RULE Pcaml.sig_item: "type"; LIST1 type_declaration SEP "and" END;

    [ [ "type"; LIDENT "nogen"; tdl = LIST1 type_declaration SEP "and" ->
          <:str_item< type $list:tdl$ >>
      | "type"; tdl = LIST1 type_declaration SEP "and" ->
          let sil = gen_ioxml_impl loc tdl in
          let sil =
            if notyp.val then sil
            else [<:str_item< type $list:tdl$ >> :: sil]
          <:str_item< declare $list:sil$ end >> ] ]

How to write value type_declaration? I cannot use Gram.Entry.find as
it is now commented out together with the whole Gram.Find module. Why?

- Dmitry Bely