support inner enum
move write to generator
support struct
fix pointer/ref field