asdlGen is a tool for generating data marshalling and
unmarshalling code from a high-level (ASDL) specification.
It can generate such code for sml, ocaml, ansi-c, java, haskell,
icon, c++.

The Abstract Syntax Description Lanuguage (ASDL) is a language
designed to describe the tree-like data structures in compilers.
Its main goal is to provide a method for compiler components
written in different languages to interoperate.

WWW: http://asdl.sourceforge.net/