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 LAA27954; Fri, 6 Jun 2003 11:57:22 +0200 (MET DST) 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 LAA28109 for ; Fri, 6 Jun 2003 11:57:21 +0200 (MET DST) Received: from carme.kasserver.com (h-62.141.48.121.keyweb.de [62.141.48.121] (may be forged)) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h569vKT04606 for ; Fri, 6 Jun 2003 11:57:20 +0200 (MET DST) Received: from kunz.ratzer (dclient217-162-174-4.hispeed.ch [217.162.174.4]) by carme.kasserver.com (8.11.6/8.11.6) with ESMTP id h569vJF13978 for ; Fri, 6 Jun 2003 11:57:19 +0200 Received: from stefan by kunz.ratzer with local (Exim 3.35 #1 (Debian)) id 19ODyN-00027a-00 for ; Fri, 06 Jun 2003 11:57:23 +0200 Date: Fri, 6 Jun 2003 11:57:23 +0200 From: Stefan Heimann To: caml-list@inria.fr Subject: [Caml-list] Automatic generation of mli files Message-ID: <20030606095723.GA8096@kunz.ratzer> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam: no; 0.00; mli:01 ocamlc:01 overwritten:01 experimented:01 ocaml:01 tree:02 exported:03 abstract:03 types:03 parse:04 implement:05 output:05 cvs:05 specify:06 source:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I searching for a way for generating the .mli file for a given source .ml file automatically. My basic idea is like that: (1) Specify in the .ml file which values and types should be exported and if a type should be exported abstract or not. This could be done with a special comment at the top of the file. (2) Filter the output of `ocamlc -i' to exclude the values and types that should not be exported and to make the types abstract if needed. Of course, the tool should check of there is an existing .mli file. If the .mli file was not generated by the tool it is not overwritten. If the list of exported values and types has not changed the .mli file is not updated too. I experimented a little bit with parsing the output of `ocamlc -i' and printing the modified parse tree. I took must code from the ocaml distribution. However, I don't think that this is a good way. Any ideas of how to implement such a tool? Are there any existing tools with this functionality? Bye, Stefan -- Stefan Heimann http://www.stefanheimann.net :: personal website. http://cvsshell.sf.net :: CvsShell, a console based cvs client. ------------------- 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