I was also writing something before you published those scripts. My method reads the original enum by tagging like the `ATTR` macros. There's a couple sed scripts, an awk script, and a shell script to tie it together.
`pp.sed` - removes preprocessor directives and `#if 0` blocks.
/^[[:blank:]]*#if 0/,/^[[:blank:]]*#endif/d
/^[[:blank:]]*#/d
```
/^[[:blank:]]\*#if 0/,/^[[:blank:]]*#endif/
/^[[:blank:]]\*#/d
```
*`enum.sed` - grabs enum definitions and permits the opening brace to be on either the same line or the next.