Suppose we have some named enums:
enum MyEnum { FOO, BAR = 0x50 };
What I googled for is a script (any language) that scans all
@hydroo: Without the extra file:
#define SOME_ENUM(DO) \ DO(Foo) \ DO(Bar) \ DO(Baz) #define MAKE_ENUM(VAR) VAR, enum MetaSyntacticVariable{ SOME_ENUM(MAKE_ENUM) }; #define MAKE_STRINGS(VAR) #VAR, const char* const MetaSyntacticVariableNames[] = { SOME_ENUM(MAKE_STRINGS) };