add code generator for enumeration, plus support code