From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA06549; Wed, 21 Jan 2004 10:01:27 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA06271 for ; Wed, 21 Jan 2004 10:01:26 +0100 (MET) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0L91Pv11821 for ; Wed, 21 Jan 2004 10:01:25 +0100 (MET) Received: from helium.pps.jussieu.fr (helium.pps.jussieu.fr [134.157.168.2]) by shiva.jussieu.fr (8.12.10/jtpda-5.4) with ESMTP id i0L91MJC054704 ; Wed, 21 Jan 2004 10:01:23 +0100 (CET) X-Ids: 164 Received: from brome (maurel@brome.pps.jussieu.fr [134.157.168.35]) by helium.pps.jussieu.fr (8.11.6/jtpda-5.3.2) with ESMTP id i0L91ML78302 ; Wed, 21 Jan 2004 10:01:22 +0100 (CET) Date: Wed, 21 Jan 2004 10:01:20 +0100 From: Francois Maurel To: caml-list@inria.fr Cc: Michael Furr Subject: [Caml-list] =?iso-8859-1?B?UmWg?= =?iso-8859-1?Q?=3A?= [Caml-list] module declarations in camlp4 Message-ID: <20040121090120.GA1346@brome.pps.jussieu.fr> References: Mime-Version: 1.0 Content-Type: text/plain; Format=Flowed; DelSp=Yes; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: (from furr@cs.umd.edu on mar, jan 20, 2004 at 23:26:37 +0100) X-Mailer: Balsa 2.0.15 X-Miltered: at shiva.jussieu.fr by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 camlp:01 module:03 module:03 binding:03 binding:03 obj:03 obj:03 let:04 let:04 parameter:04 parameter:04 grammar:05 grammar:05 str:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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 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