I have to define high level definition of objects such as :
obj1 => [
name => "object1",
type => "uint64",
dependents => [
{type => "unit32", name => "dep1"},
{type => "uint32", name => "dep2"}
],
default_value = "100"
]
From this I want to generate the C structures and some helper routines such as:
struct_dependents {
int type;
char name[MAX];
}
struct struct_obj1 {
char name[MAX];
int type;
struct dependents deps[MAX_DEP];
unit64 default_value;
}
// Some initializations..
Earlier I thought I could define the high level objects in .pm (perl module) files and then use perl to generate C code, but writing code to generate C code this way might be error prone and tough to maintain if object definitions change in future.
What I want to know is that - are there any such ready made tools which allow us to write high level object definition and auto generate their C structures?