From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C3D0EBBBB for ; Tue, 28 Feb 2006 21:56:48 +0100 (CET) Received: from localhost.localdomain (dslb-084-063-000-162.pools.arcor-ip.net [84.63.0.162]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1SKumtC024233 for ; Tue, 28 Feb 2006 21:56:48 +0100 Received: from puck (localhost.localdomain [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id C22EC4B263A; Tue, 28 Feb 2006 21:56:46 +0100 (CET) Date: Tue, 28 Feb 2006 20:56:46 +0000 From: philip Reply-To: feucht@uni-koblenz.de Subject: Re: [Caml-list] xml tree -- variant type tree To: Hendrik Tews Cc: caml-list@yquem.inria.fr References: <17412.27387.963123.675231@ithif59.inf.tu-dresden.de> In-Reply-To: <17412.27387.963123.675231@ithif59.inf.tu-dresden.de> (from tews@tcs.inf.tu-dresden.de on Tue Feb 28 16:23:39 2006) X-Mailer: Balsa 2.3.3 Message-Id: <1141160206l.7259l.1l@puck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-j-chkmail-Score: MSGID : 4404B910.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 4404B910.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hendrik:01 tews:01 corresponds:01 nodes:01 humps:01 gerd:01 pxp:01 syntax:01 parser:01 ocaml:01 syntax:01 ocaml:01 hendrik:01 caml-list:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On 02/28/2006 04:23:39 PM, Hendrik Tews wrote: > Hi, >=20 > I would like to read an XML file into an element of some variant > type, where each constructor corresponds to precisely one type of > xml nodes. Of course I would need to define the variant type > beforehand. But how to proceed then? >=20 > The humps give me the impression that the right library to use is > Gerd Stolpmanns pxp. However, this library will produce an object > tree, which I could probably convert into a variant type with > some effort. >=20 > An alternative would be to use XML-Light, which produces string > labelled trees, and to translate these string trees myself. >=20 > Is there some better solution? >=20 >=20 > Background: I would like to manipulate abstract syntax trees of > C++ programs. I couldn't find a C++ parser in Ocaml, therefore I > would like to use Elkhound/Elsa > (http://www.cs.berkeley.edu/~smcpeak/elkhound/), which can output > the abstract syntax tree as xml file. Extending Elsa is not an > option, because for ast manipulations I prefer ocaml pattern > matching over C++ visitors. >=20 > Bye, >=20 > Hendrik >=20 > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 >=20 Hi Hendrik, i parsed some with tom, it is very efficient: http://tom.loria.fr/index.php -Philip --=20 And remember, "For every complex problem, there is a solution that is =20 simple, neat, and wrong."