caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* xml tree -- variant type tree
@ 2006-02-28 15:23 Hendrik Tews
  2006-02-28 15:43 ` [Caml-list] " Michael Wohlwend
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Hendrik Tews @ 2006-02-28 15:23 UTC (permalink / raw)
  To: caml-list

Hi,

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?

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. 

An alternative would be to use XML-Light, which produces string
labelled trees, and to translate these string trees myself.

Is there some better solution?


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.

Bye,

Hendrik


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

end of thread, other threads:[~2006-02-28 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-28 15:23 xml tree -- variant type tree Hendrik Tews
2006-02-28 15:43 ` [Caml-list] " Michael Wohlwend
2006-02-28 15:52   ` Alain Frisch
2006-02-28 15:47 ` Richard Jones
2006-02-28 15:57   ` Michael Wohlwend
2006-02-28 16:24     ` Alain Frisch
2006-02-28 18:11       ` Michael Wohlwend
2006-02-28 20:56 ` philip

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