Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 9feb34b1fca12748b7d48737024da48e342f5c07)
+++ src/CodeGen/CodeGenerator.cc	(revision 28f8f154b94c0b9fd3ef74a8d0de01187a5522c6)
@@ -295,6 +295,21 @@
 	}
 
+	void CodeGenerator::handleData( EnumDecl * dataDecl ) {
+		output << " /** data type */" << endl;
+		for ( StructDecl * decl : dataDecl->data_constructors ) {
+			postvisit(decl);
+			output << ";" << endl;
+		}
+		postvisit( dataDecl->data_union );
+		output << ";" << endl;
+		postvisit( dataDecl->tags );
+		output << ";" << endl;
+		postvisit( dataDecl->tag_union );
+		output << ";" << endl;
+	}
+
 	void CodeGenerator::postvisit( EnumDecl * enumDecl ) {
-		extension( enumDecl );
+		if ( enumDecl->data_constructors.size() > 0 ) return handleData( enumDecl );
+ 		extension( enumDecl );
 		std::list< Declaration* > &memb = enumDecl->get_members();
 		if (enumDecl->base && ! memb.empty()) {
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision 9feb34b1fca12748b7d48737024da48e342f5c07)
+++ src/CodeGen/CodeGenerator.h	(revision 28f8f154b94c0b9fd3ef74a8d0de01187a5522c6)
@@ -165,4 +165,6 @@
 		void handleTypedef( NamedTypeDecl *namedType );
 		std::string mangleName( DeclarationWithType * decl );
+
+		void handleData( EnumDecl * EnumDecl );
 	}; // CodeGenerator
 
