caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* New Camlp4 questions
@ 2007-06-07  9:54 Dmitry Bely
  2007-06-07 13:32 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Bely @ 2007-06-07  9:54 UTC (permalink / raw)
  To: Caml List

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";

and

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;

EXTEND
  Pcaml.str_item:
    [ [ "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]
          in
          <:str_item< declare $list:sil$ end >> ] ]
  ;
[...]
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] New Camlp4 questions
  2007-06-07  9:54 New Camlp4 questions Dmitry Bely
@ 2007-06-07 13:32 ` Nicolas Pouillard
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pouillard @ 2007-06-07 13:32 UTC (permalink / raw)
  To: Dmitry Bely; +Cc: Caml List

On 6/7/07, Dmitry Bely <dmitry.bely@gmail.com> wrote:
> 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";

In the last version it's:

open Camlp4.PreCast;;

Syntax.print_warning loc "...."

[...]

> 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?

Look at the grammar the type_declaration entry is exported now.

All the best,

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-07 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-07  9:54 New Camlp4 questions Dmitry Bely
2007-06-07 13:32 ` [Caml-list] " Nicolas Pouillard

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).