enum code generation