added code generator for union
completed code generator for union