after installing datadec (from 9.datadec) into your TOOLDIR,
let's play:
- prepare an input file, such as types.in, containing:
TYPE {
       intlist =  null or cons( int first, intlist next );
       illist  =  null or cons( intlist first, illist next );
       idtree  =  leaf( string id )
	       or node( idtree left, idtree right );
}
- To generate C code implementing these types, invoke:
    datadec datatypes types.in
- this generates datatypes.h and datatypes.c.
- there's a test program testtypes.c and a Makefile
  that compiles everything (it even knows how to
  generate datatypes.[ch] from types.in)
- make
- ./testtypes
