I have some functions that can be defined by users like :
int prop1(....) {
if(...)
return Prop2;
return Failed;
}
int prop2(...) {
if(...)
return Prop3;
return Failed;
}
I want to create a file if the dependencies between the different functions.
Is there some way to generate a Enum at compile time and parse the file with some kind of regex to extract the different return tokens in a function and write it to a file.
It is not possible to create an
enumat compile time.You can parse the file before and create a file.h from it so that you can include it in your program, but nothing else.
Obviously you can automate this mechanism with a script.