Java and C++ tokenizer and constant class/define thingie...

This little script was initially just to save some typeing caused by the lack of #define for constants in Java. It does a bit more than just set up the public static final variables, because it's written for a specific purpose relateing one particular project. Basically, this was one of these situations where it was quicker to write a wizard than to code directly (as well as being more fun). C++ support was added later.

Assign IDs to a list of words (Java output)
Assign IDs to a list of words (C++ output)
Translate C++ # defines to Java

Create a class - name

Create a token identifier function
(This is just something I need for my current project, there's nothing remotely standard about it, and there probably are much better ways of doing the same thing.)

Prefix for #defines

Create a case statement using the identfiers.

This wizard is copyright © Niall S F Barr, 2004-2008. Niall Barr makes no claim on the copyright of any generated code.