Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 2583407f072cd387664af9ce2f5e73d4e123318f)
+++ src/Parser/parser.yy	(revision 30ee3155f87ed3c2c3cdc7ec005fffe35fd32abe)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Mar 11 18:30:03 2024
-// Update Count     : 6589
+// Last Modified On : Sat Mar 16 11:17:15 2024
+// Update Count     : 6599
 //
 
@@ -2742,8 +2742,32 @@
 
 enum_type:
-	ENUM attribute_list_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( nullptr, $4, true, false )->addQualifiers( $2 ); }
-	| ENUM attribute_list_opt '!' '{' enumerator_list comma_opt '}'	// invalid syntax rule
+		// anonymous, no type name 
+	ENUM attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
+		{
+			if ( $3 == EnumHiding::Hide ) {
+				SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr;
+			} // if
+			$$ = DeclarationNode::newEnum( nullptr, $5, true, false )->addQualifiers( $2 );
+		}
+		// pure enumeration
+	| ENUM '(' ')' attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
+		{
+			if ( $5 == EnumHiding::Hide ) {
+				SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr;
+			} // if
+			$$ = DeclarationNode::newEnum( nullptr, $7, true, true )->addQualifiers( $4 );
+		}
+		// typed enumeration
+	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}'
+		{
+			if ( $3->storageClasses.val != 0 || $3->type->qualifiers.any() ) {
+				SemanticError( yylloc, "syntax error, storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." );
+			}
+			$$ = DeclarationNode::newEnum( nullptr, $7, true, true, $3 )->addQualifiers( $5 );
+		}
+	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // unqualified type name
 		{ SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
+
+		// type name
 	| ENUM attribute_list_opt identifier
 		{ typedefTable.makeTypedef( *$3, "enum_type 1" ); }
@@ -2752,19 +2776,16 @@
 	| ENUM attribute_list_opt typedef_name hide_opt '{' enumerator_list comma_opt '}' // unqualified type name
 		{ $$ = DeclarationNode::newEnum( $3->name, $6, true, false, nullptr, $4 )->addQualifiers( $2 ); }
-	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}'
-		{
-			if ( $3->storageClasses.val != 0 || $3->type->qualifiers.any() ) {
-				SemanticError( yylloc, "syntax error, storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." );
-			}
-			$$ = DeclarationNode::newEnum( nullptr, $7, true, true, $3 )->addQualifiers( $5 );
-		}
-	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // unqualified type name
-		{ SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
-	| ENUM '(' ')' attribute_list_opt '{' enumerator_list comma_opt '}'
-		{
-			$$ = DeclarationNode::newEnum( nullptr, $6, true, true )->addQualifiers( $4 );
-		}
-	| ENUM '(' ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}'	// invalid syntax rule
-		{ SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
+		// pure enumeration
+	| ENUM '(' ')' attribute_list_opt identifier attribute_list_opt
+		{ typedefTable.makeTypedef( *$5, "enum_type 2" ); }
+	  hide_opt '{' enumerator_list comma_opt '}'
+		{
+			$$ = DeclarationNode::newEnum( $5, $10, true, true, nullptr, $8 )->addQualifiers( $4 )->addQualifiers( $6 );
+		}
+	| ENUM '(' ')' attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
+		{
+			$$ = DeclarationNode::newEnum( $5->name, $9, true, true, nullptr, $7 )->addQualifiers( $4 )->addQualifiers( $6 );
+		}
+		// typed enumeration
 	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt
 		{
@@ -2772,5 +2793,5 @@
 				SemanticError( yylloc, "syntax error, storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." );
 			}
-			typedefTable.makeTypedef( *$6, "enum_type 2" );
+			typedefTable.makeTypedef( *$6, "enum_type 3" );
 		}
 	  hide_opt '{' enumerator_list comma_opt '}'
@@ -2778,16 +2799,10 @@
 			$$ = DeclarationNode::newEnum( $6, $11, true, true, $3, $9 )->addQualifiers( $5 )->addQualifiers( $7 );
 		}
-	| ENUM '(' ')' attribute_list_opt identifier attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
-		{
-			$$ = DeclarationNode::newEnum( $5, $9, true, true, nullptr, $7 )->addQualifiers( $4 )->addQualifiers( $6 );
-		}
 	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
 		{
 			$$ = DeclarationNode::newEnum( $6->name, $10, true, true, $3, $8 )->addQualifiers( $5 )->addQualifiers( $7 );
 		}
-	| ENUM '(' ')' attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
-		{
-			$$ = DeclarationNode::newEnum( $5->name, $9, true, true, nullptr, $7 )->addQualifiers( $4 )->addQualifiers( $6 );
-		}
+
+		// forward declaration
 	| enum_type_nobody
 	;
