caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois Maurel <Francois.Maurel@pps.jussieu.fr>
To: caml-list@inria.fr
Cc: Michael Furr <furr@cs.umd.edu>
Subject: [Caml-list] Re : [Caml-list] module declarations in camlp4
Date: Wed, 21 Jan 2004 10:01:20 +0100	[thread overview]
Message-ID: <20040121090120.GA1346@brome.pps.jussieu.fr> (raw)
In-Reply-To: <Pine.SOL.4.33.0401201714150.4568-100000@toblerone.cs.umd.edu> (from furr@cs.umd.edu on mar, jan 20, 2004 at 23:26:37 +0100)

> However, since the entry "module_binding" is not defined to be  
> GLOBAL, I can not access it here.  Does anyone have any suggestions  
> about how to get around this?  Is there any specific reason that some   
> of the grammar entries are defined locally?

For a similar problem, I used Grammar.Entry.find under a Obj.magic.

let type_declaration =
  Obj.magic (Grammar.Entry.find str_item "type_declaration")
let type_kind =
  Obj.magic (Grammar.Entry.find type_declaration "type_kind")
let type_parameters =
  Obj.magic (Grammar.Entry.find type_declaration "type_parameters")
let type_parameter =
  Obj.magic (Grammar.Entry.find type_parameters "type_parameter")

As far as I understand, the expression <str_item> is the first entry  
where module_binding appears in pa_o.ml which explains the use of:
- type_declaration in my example for type_kind or type_parameters
- type_parameters  in my example for type_parameter

So you should try

let module_binding =
  Obj.magic (Grammar.Entry.find str_item "module_binding")

--
Francois

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      reply	other threads:[~2004-01-21  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-20 22:26 Michael Furr
2004-01-21  9:01 ` Francois Maurel [this message]

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=20040121090120.GA1346@brome.pps.jussieu.fr \
    --to=francois.maurel@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    --cc=furr@cs.umd.edu \
    /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).