struct to json/yaml/xml/whatever codegen

Daniel N via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 29 02:45:08 PDT 2016


Is anyone aware of a tool which does something akin to the 
following:

Given a C-like definition, automatically generate pure C code 
with no dependencies.

Input c-struct:
   struct Person
   {
     int   id;
     char* name;
   }	

Output minimal c-code:
   void dumpPerson(Person* p)
   {
   	printf("<Person><id>%d</id><name>%s</name></Person>", p->id, 
p->name);	
   }

It's easy to write in D... just want to avoid reinventing the 
wheel.




More information about the Digitalmars-d-learn mailing list