Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision fd54fef231baeeb0016103bf19cc8e6d87287faf)
+++ src/Parser/parser.yy	(revision 408ab79bf73408df3e1ab6b684f98b5ea7e19881)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan 11 21:32:10 2021
-// Update Count     : 4633
+// Last Modified On : Mon Jan 25 21:41:56 2021
+// Update Count     : 4670
 //
 
@@ -63,5 +63,5 @@
 extern TypedefTable typedefTable;
 
-stack< LinkageSpec::Spec > linkageStack;
+stack<LinkageSpec::Spec> linkageStack;
 
 bool appendStr( string & to, string & from ) {
@@ -187,5 +187,5 @@
 	ConstantExpr * constant = dynamic_cast<ConstantExpr *>(type->expr.get());
 	if ( constant && (constant->get_constant()->get_value() == "0" || constant->get_constant()->get_value() == "1") ) {
-    	type = new ExpressionNode( new CastExpr( maybeMoveBuild< Expression >(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
+    	type = new ExpressionNode( new CastExpr( maybeMoveBuild<Expression>(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
 	} // if
 	return new ForCtrl(
@@ -440,10 +440,10 @@
 
 %type<decl> type_qualifier type_qualifier_name forall type_qualifier_list_opt type_qualifier_list
-%type<decl> type_specifier type_specifier_nobody
+%type<decl> type_specifier type_specifier_nobody enum_specifier_nobody
 
 %type<decl> variable_declarator variable_ptr variable_array variable_function
 %type<decl> variable_abstract_declarator variable_abstract_ptr variable_abstract_array variable_abstract_function
 
-%type<decl> attribute_list_opt attribute_list attribute_name_list attribute attribute_name
+%type<decl> attribute_list_opt attribute_list attribute_opt attribute attribute_name_list attribute_name
 
 // initializers
@@ -578,5 +578,5 @@
 		{ $$ = $2; }
 	| '(' compound_statement ')'						// GCC, lambda expression
-		{ $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
+		{ $$ = new ExpressionNode( new StmtExpr( dynamic_cast<CompoundStmt *>(maybeMoveBuild<Statement>($2) ) ) ); }
 	| type_name '.' identifier							// CFA, nested type
 		{ SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
@@ -610,8 +610,8 @@
 		{
 			// create a GenericExpr wrapper with one association pair
-			$$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>($3) } } );
+			$$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>( $3 ) } } );
 		}
 	| DEFAULT ':' assignment_expression
-		{ $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); }
+		{ $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>( $3 ) } } ); }
 	;
 
@@ -743,5 +743,5 @@
 			switch ( $1 ) {
 			  case OperKinds::AddressOf:
-				$$ = new ExpressionNode( new AddressExpr( maybeMoveBuild< Expression >( $2 ) ) );
+				$$ = new ExpressionNode( new AddressExpr( maybeMoveBuild<Expression>( $2 ) ) );
 				break;
 			  case OperKinds::PointTo:
@@ -749,5 +749,5 @@
 				break;
 			  case OperKinds::And:
-				$$ = new ExpressionNode( new AddressExpr( new AddressExpr( maybeMoveBuild< Expression >( $2 ) ) ) );
+				$$ = new ExpressionNode( new AddressExpr( new AddressExpr( maybeMoveBuild<Expression>( $2 ) ) ) );
 				break;
 			  default:
@@ -762,9 +762,9 @@
 	  	{ $$ = new ExpressionNode( build_unary_ptr( OperKinds::Decr, $2 ) ); }
 	| SIZEOF unary_expression
-		{ $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuild< Expression >( $2 ) ) ); }
+		{ $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuild<Expression>( $2 ) ) ); }
 	| SIZEOF '(' type_no_function ')'
 		{ $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuildType( $3 ) ) ); }
 	| ALIGNOF unary_expression							// GCC, variable alignment
-		{ $$ = new ExpressionNode( new AlignofExpr( maybeMoveBuild< Expression >( $2 ) ) ); }
+		{ $$ = new ExpressionNode( new AlignofExpr( maybeMoveBuild<Expression>( $2 ) ) ); }
 	| ALIGNOF '(' type_no_function ')'					// GCC, type alignment
 		{ $$ = new ExpressionNode( new AlignofExpr( maybeMoveBuildType( $3 ) ) ); }
@@ -794,7 +794,7 @@
 		{ $$ = new ExpressionNode( build_keyword_cast( $2, $5 ) ); }
 	| '(' VIRTUAL ')' cast_expression					// CFA
-		{ $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr ) ) ); }
+		{ $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild<Expression>( $4 ), maybeMoveBuildType( nullptr ) ) ); }
 	| '(' VIRTUAL type_no_function ')' cast_expression	// CFA
-		{ $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $5 ), maybeMoveBuildType( $3 ) ) ); }
+		{ $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild<Expression>( $5 ), maybeMoveBuildType( $3 ) ) ); }
 	| '(' RETURN type_no_function ')' cast_expression	// CFA
 		{ SemanticError( yylloc, "Return cast is currently unimplemented." ); $$ = nullptr; }
@@ -977,5 +977,5 @@
 	assignment_expression
 	| comma_expression ',' assignment_expression
-		{ $$ = new ExpressionNode( new CommaExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); }
+		{ $$ = new ExpressionNode( new CommaExpr( maybeMoveBuild<Expression>( $1 ), maybeMoveBuild<Expression>( $3 ) ) ); }
 	;
 
@@ -1102,5 +1102,5 @@
 	constant_expression							{ $$ = $1; }
 	| constant_expression ELLIPSIS constant_expression	// GCC, subrange
-		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); }
+		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild<Expression>( $1 ), maybeMoveBuild<Expression>( $3 ) ) ); }
 	| subrange											// CFA, subrange
 	;
@@ -1448,7 +1448,7 @@
 asm_operand:											// GCC
 	string_literal '(' constant_expression ')'
-		{ $$ = new ExpressionNode( new AsmExpr( nullptr, $1, maybeMoveBuild< Expression >( $3 ) ) ); }
+		{ $$ = new ExpressionNode( new AsmExpr( nullptr, $1, maybeMoveBuild<Expression>( $3 ) ) ); }
 	| '[' IDENTIFIER ']' string_literal '(' constant_expression ')'
-		{ $$ = new ExpressionNode( new AsmExpr( $2, $4, maybeMoveBuild< Expression >( $6 ) ) ); }
+		{ $$ = new ExpressionNode( new AsmExpr( $2, $4, maybeMoveBuild<Expression>( $6 ) ) ); }
 	;
 
@@ -1736,4 +1736,14 @@
 	| sue_type_specifier_nobody
 	| type_type_specifier
+	;
+
+enum_specifier_nobody:									// type specifier - {...}
+		// Preclude SUE declarations in restricted scopes:
+		//
+		//    int f( struct S { int i; } s1, Struct S s2 ) { struct S s3; ... }
+		//
+		// because it is impossible to call f due to name equivalence.
+	basic_type_specifier
+	| sue_type_specifier_nobody
 	;
 
@@ -2184,24 +2194,34 @@
 	;
 
+// Cannot use attribute_list_opt because of ambiguity with enum_specifier_nobody, which already parses attributes.
 enum_type:												// enum
-	ENUM attribute_list_opt '{' enumerator_list comma_opt '}'
+	ENUM attribute_opt '{' enumerator_list comma_opt '}'
 		{ $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); }
-	| ENUM attribute_list_opt identifier
+	| ENUM attribute_opt identifier
 		{ typedefTable.makeTypedef( *$3 ); }
 	  '{' enumerator_list comma_opt '}'
 		{ $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); }
-	| ENUM attribute_list_opt type_name
+	| ENUM attribute_opt typedef
 	  '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $3->type->symbolic.name, $5, true )->addQualifiers( $2 ); }
+		{ $$ = DeclarationNode::newEnum( $3->name, $5, true )->addQualifiers( $2 ); }
+	| ENUM enum_specifier_nobody '{' enumerator_list comma_opt '}'
+		// { $$ = DeclarationNode::newEnum( nullptr, $4, true ); }
+		{ SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; }
+	| ENUM enum_specifier_nobody declarator '{' enumerator_list comma_opt '}'
+		// {
+		// 	typedefTable.makeTypedef( *$3->name );
+		// 	$$ = DeclarationNode::newEnum( nullptr, $5, true );
+		// }
+		{ SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; }
 	| enum_type_nobody
 	;
 
 enum_type_nobody:										// enum - {...}
-	ENUM attribute_list_opt identifier
+	ENUM attribute_opt identifier
 		{
 			typedefTable.makeTypedef( *$3 );
 			$$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 );
 		}
-	| ENUM attribute_list_opt type_name
+	| ENUM attribute_opt type_name
 		{
 			typedefTable.makeTypedef( *$3->type->symbolic.name );
@@ -2220,6 +2240,8 @@
 	// empty
 		{ $$ = nullptr; }
-	| '=' constant_expression
-		{ $$ = $2; }
+	// | '=' constant_expression
+	// 	{ $$ = $2; }
+	| '=' initializer
+		{ $$ = $2->get_expression(); }					// FIX ME: enum only deals with constant_expression
 	;
 
@@ -2403,5 +2425,5 @@
 		{ $$ = $3; }
 	| '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements
-		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); }
+		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild<Expression>( $3 ), maybeMoveBuild<Expression>( $5 ) ) ); }
 	| '.' '[' push field_name_list pop ']'				// CFA, tuple field selector
 		{ $$ = $4; }
@@ -2441,5 +2463,6 @@
 type_parameter:											// CFA
 	type_class identifier_or_type_name
-		{   typedefTable.addToScope( *$2, TYPEDEFname, "9" );
+		{
+			typedefTable.addToScope( *$2, TYPEDEFname, "9" );
 			if ( $1 == TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated" ); }
 			if ( $1 == TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated" ); }
@@ -2738,5 +2761,5 @@
 subrange:
 	constant_expression '~' constant_expression			// CFA, integer subrange
-		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); }
+		{ $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild<Expression>( $1 ), maybeMoveBuild<Expression>( $3 ) ) ); }
 	;
 
@@ -2762,4 +2785,10 @@
 	| attribute_list attribute
 		{ $$ = $2->addQualifiers( $1 ); }
+	;
+
+attribute_opt:
+	// empty
+		{ $$ = nullptr; }
+	| attribute
 	;
 
