This is only part of the solution, we still need to update joy.h and KEYWORDS.txt when defs.txt changes, and we need to handle names that have non-C-identifier characters in them. But it's a start...