Index: src/Parser/StatementNode.cpp
===================================================================
--- src/Parser/StatementNode.cpp	(revision 90e683bd043dbecee5fc34eec99bc3d53f59d082)
+++ src/Parser/StatementNode.cpp	(revision 3ae2069b7565944d782e763cc7cd124694f0a2ed)
@@ -10,7 +10,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Sat May 16 14:59:41 2015
-// Last Modified By : Kyoung Seo
-// Last Modified On : Thd Jan 16 13:05:00 2025
-// Update Count     : 433
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Feb  6 11:38:39 2025
+// Update Count     : 434
 //
 
@@ -70,4 +70,10 @@
 	stmt.reset( new ast::DeclStmt( declLocation, maybeMoveBuild( agg ) ) );
 } // StatementNode::StatementNode
+
+StatementNode * StatementNode::addQualifiers( DeclarationNode * attr ) {
+	if ( ! attr ) { return this; }						// empty attribute list
+	attributes.insert( attributes.end(), attr->attributes.begin(), attr->attributes.end() );
+	return this;
+}
 
 StatementNode * StatementNode::add_label(
Index: src/Parser/StatementNode.hpp
===================================================================
--- src/Parser/StatementNode.hpp	(revision 90e683bd043dbecee5fc34eec99bc3d53f59d082)
+++ src/Parser/StatementNode.hpp	(revision 3ae2069b7565944d782e763cc7cd124694f0a2ed)
@@ -10,6 +10,6 @@
 // Created On       : Wed Apr  5 11:42:00 2023
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Sep 23 22:43:05 2024
-// Update Count     : 3
+// Last Modified On : Thu Feb  6 11:39:26 2025
+// Update Count     : 6
 //
 
@@ -27,4 +27,5 @@
 	ast::Stmt * build() { return stmt.release(); }
 
+	StatementNode * addQualifiers( DeclarationNode * );
 	StatementNode * add_label(
 			const CodeLocation & location,
@@ -36,4 +37,5 @@
 	}
 
+	std::vector<ast::ptr<ast::Attribute>> attributes;
 	std::unique_ptr<ast::Stmt> stmt;
 }; // StatementNode
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 90e683bd043dbecee5fc34eec99bc3d53f59d082)
+++ src/Parser/parser.yy	(revision 3ae2069b7565944d782e763cc7cd124694f0a2ed)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jan 17 14:35:08 2025
-// Update Count     : 6935
+// Last Modified On : Thu Feb  6 11:40:06 2025
+// Update Count     : 7236
 //
 
@@ -54,4 +54,7 @@
 #include "Common/SemanticError.hpp"                     // error_str
 #include "Common/Utility.hpp"                           // for maybeMoveBuild, maybeBuild, CodeLo...
+#include "AST/Attribute.hpp"         // for Attribute
+#include "AST/Print.hpp"             // for print
+#include "Common/Iterate.hpp"        // for reverseIterate
 
 // lex uses __null in a boolean context, it's fine.
@@ -98,5 +101,5 @@
 } // appendStr
 
-DeclarationNode * distAttr( DeclarationNode * typeSpec, DeclarationNode * declList ) {
+DeclarationNode * distTypeSpec( DeclarationNode * typeSpec, DeclarationNode * declList ) {
 	// Distribute type specifier across all declared variables, e.g., static, const, __attribute__.
 	assert( declList );
@@ -132,10 +135,19 @@
 	declList->addType( cl, copyattr );					// cl IS DELETED!!!
 	return declList;
+} // distTypeSpec
+
+void distAttr( DeclarationNode * attributes, DeclarationNode * declaration ) {
+	// distribute attributes across all declaring list
+	for ( DeclarationNode * attr = attributes; attr != nullptr ; attr = attr->next ) {
+		for ( DeclarationNode * decl = declaration ; decl != nullptr ; decl = decl->next ) {
+			decl->attributes.insert( decl->attributes.begin(), attr->attributes.begin(), attr->attributes.end() );
+		} // for
+	} // for
 } // distAttr
 
 void distExt( DeclarationNode * declaration ) {
 	// distribute EXTENSION across all declarations
-	for ( DeclarationNode *iter = declaration ; iter != nullptr ; iter = iter->next ) {
-		iter->set_extension( true );
+	for ( DeclarationNode * decl = declaration ; decl != nullptr ; decl = decl->next ) {
+		decl->set_extension( true );
 	} // for
 } // distExt
@@ -143,6 +155,6 @@
 void distInl( DeclarationNode * declaration ) {
 	// distribute INLINE across all declarations
-	for ( DeclarationNode *iter = declaration ; iter != nullptr ; iter = iter->next ) {
-		iter->set_inLine( true );
+	for ( DeclarationNode *decl = declaration ; decl != nullptr ; decl = decl->next ) {
+		decl->set_inLine( true );
 	} // for
 } // distInl
@@ -150,5 +162,5 @@
 void distQual( DeclarationNode * declaration, DeclarationNode * qualifiers ) {
 	// distribute qualifiers across all non-variable declarations in a distribution statemement
-	for ( DeclarationNode * iter = declaration ; iter != nullptr ; iter = iter->next ) {
+	for ( DeclarationNode * decl = declaration ; decl != nullptr ; decl = decl->next ) {
 		// SKULLDUGGERY: Distributions are parsed inside out, so qualifiers are added to declarations inside out. Since
 		// addQualifiers appends to the back of the list, the forall clauses are in the wrong order (right to left). To
@@ -157,20 +169,20 @@
 		DeclarationNode * clone = qualifiers->clone();
 		if ( qualifiers->type ) {						// forall clause ? (handles SC)
-			if ( iter->type->kind == TypeData::Aggregate ) { // struct/union ?
-				swap( clone->type->forall, iter->type->aggregate.params );
-				iter->addQualifiers( clone );
-			} else if ( iter->type->kind == TypeData::AggregateInst && iter->type->aggInst.aggregate->aggregate.body ) { // struct/union ?
+			if ( decl->type->kind == TypeData::Aggregate ) { // struct/union ?
+				swap( clone->type->forall, decl->type->aggregate.params );
+				decl->addQualifiers( clone );
+			} else if ( decl->type->kind == TypeData::AggregateInst && decl->type->aggInst.aggregate->aggregate.body ) { // struct/union ?
 				// Create temporary node to hold aggregate, call addQualifiers as above, then put nodes back together.
 				DeclarationNode newnode;
-				swap( newnode.type, iter->type->aggInst.aggregate );
+				swap( newnode.type, decl->type->aggInst.aggregate );
 				swap( clone->type->forall, newnode.type->aggregate.params );
 				newnode.addQualifiers( clone );
-				swap( newnode.type, iter->type->aggInst.aggregate );
-			} else if ( iter->type->kind == TypeData::Function ) { // routines ?
-				swap( clone->type->forall, iter->type->forall );
-				iter->addQualifiers( clone );
+				swap( newnode.type, decl->type->aggInst.aggregate );
+			} else if ( decl->type->kind == TypeData::Function ) { // routines ?
+				swap( clone->type->forall, decl->type->forall );
+				decl->addQualifiers( clone );
 			} // if
 		} else {										// just SC qualifiers
-			iter->addQualifiers( clone );
+			decl->addQualifiers( clone );
 		} // if
 	} // for
@@ -210,5 +222,5 @@
 
 	// printf( "fieldDecl3 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout, 0 );
-	DeclarationNode * temp = distAttr( typeSpec, fieldList ); // mark all fields in list
+	DeclarationNode * temp = distTypeSpec( typeSpec, fieldList ); // mark all fields in list
 	// printf( "fieldDecl4 temp %p\n", temp ); temp->print( std::cout, 0 );
 	return temp;
@@ -253,5 +265,5 @@
 		type = new ExpressionNode( new ast::CastExpr( location, maybeMoveBuild(type), new ast::BasicType( ast::BasicKind::SignedInt ) ) );
 	} // if
-	DeclarationNode * initDecl = distAttr(
+	DeclarationNode * initDecl = distTypeSpec(
 		DeclarationNode::newTypeof( type, true ),
 		DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) )
@@ -434,5 +446,5 @@
 %type<decl> asm_name_opt
 %type<expr> asm_operands_opt			asm_operands_list			asm_operand
-%type<labels> label_list
+%type<labels> asm_label_list
 %type<expr> asm_clobbers_list_opt
 %type<is_volatile> asm_volatile_opt
@@ -441,5 +453,5 @@
 
 // statements
-%type<stmt> statement					labeled_statement			compound_statement
+%type<stmt> statement					labelled_statement			compound_statement
 %type<stmt> statement_decl				statement_decl_list			statement_list_nodecl
 %type<stmt> selection_statement
@@ -926,4 +938,6 @@
 	| SIZEOF '(' type_no_function ')'
 		{ $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }
+	| SIZEOF '(' attribute_list type_no_function ')'
+		{ $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $4->addQualifiers( $3 ) ) ) ); }
 	| ALIGNOF unary_expression							// GCC, variable alignment
 		{ $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); }
@@ -1202,5 +1216,5 @@
 
 statement:
-	labeled_statement
+	labelled_statement
 	| compound_statement
 	| expression_statement
@@ -1220,9 +1234,7 @@
 	| DIRECTIVE
 		{ $$ = new StatementNode( build_directive( yylloc, $1 ) ); }
-//	| attribute ';'
-//		{ $$ = new StatementNode( $1 ); } 
-	;
-
-labeled_statement:
+	;
+
+labelled_statement:
 		// labels cannot be identifiers 0 or 1
 	identifier_or_type_name ':' attribute_list_opt statement
@@ -1254,19 +1266,21 @@
 
 statement_decl:
-	declaration											// CFA, new & old style declarations
-		{ $$ = new StatementNode( $1 ); }
-	| EXTENSION declaration								// GCC
-		{ distExt( $2 ); $$ = new StatementNode( $2 ); }
-	| function_definition
-		{ $$ = new StatementNode( $1 ); }
-	| EXTENSION function_definition						// GCC
-		{ distExt( $2 ); $$ = new StatementNode( $2 ); }
-	| statement
+	attribute_list_opt declaration						// CFA, new & old style declarations
+		{ distAttr( $1, $2 ); $$ = new StatementNode( $2 ); }
+	| attribute_list_opt EXTENSION declaration			// GCC
+		{ distAttr( $1, $3 ); distExt( $3 ); $$ = new StatementNode( $3 ); }
+	| attribute_list_opt function_definition
+		{ distAttr( $1, $2 ); $$ = new StatementNode( $2 ); }
+	| attribute_list_opt EXTENSION function_definition	// GCC
+		{ distAttr( $1, $3 ); distExt( $3 ); $$ = new StatementNode( $3 ); }
+	| attribute_list_opt statement						// FIX ME!
+		{ $$ = $2->addQualifiers( $1 ); }
 	;
 
 statement_list_nodecl:
-	statement
-	| statement_list_nodecl statement
-		{ assert( $1 ); $1->set_last( $2 ); $$ = $1; }
+	attribute_list_opt statement
+		{ $$ = $2->addQualifiers( $1 ); }									// FIX ME!
+	| statement_list_nodecl attribute_list_opt statement
+		{ assert( $1 ); $1->set_last( $3->addQualifiers( $2 ) ); $$ = $1; }	// FIX ME!
 	| statement_list_nodecl error						// invalid syntax rule
 		{ SemanticError( yylloc, "illegal syntax, declarations only allowed at the start of the switch body,"
@@ -1274,5 +1288,5 @@
 	;
 
-expression_statement:
+expression_statement:									// expression or null statement
 	comma_expression_opt ';'
 		{ $$ = new StatementNode( build_expr( yylloc, $1 ) ); }
@@ -1903,5 +1917,5 @@
 	| ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ':' asm_clobbers_list_opt ')' ';'
 		{ $$ = new StatementNode( build_asm( yylloc, $2, $4, $6, $8, $10 ) ); }
-	| ASM asm_volatile_opt GOTO '(' string_literal ':' ':' asm_operands_opt ':' asm_clobbers_list_opt ':' label_list ')' ';'
+	| ASM asm_volatile_opt GOTO '(' string_literal ':' ':' asm_operands_opt ':' asm_clobbers_list_opt ':' asm_label_list ')' ';'
 		{ $$ = new StatementNode( build_asm( yylloc, $2, $5, nullptr, $8, $10, $12 ) ); }
 	;
@@ -1945,15 +1959,9 @@
 	;
 
-label_list:
-	identifier
-		{
-			$$ = new LabelNode(); $$->labels.emplace_back( yylloc, *$1 );
-			delete $1;									// allocated by lexer
-		}
-	| label_list ',' identifier
-		{
-			$$ = $1; $1->labels.emplace_back( yylloc, *$3 );
-			delete $3;									// allocated by lexer
-		}
+asm_label_list:
+	identifier_or_type_name
+		{ $$ = new LabelNode(); $$->labels.emplace_back( yylloc, *$1 ); delete $1; } // allocated by lexer
+	| asm_label_list ',' identifier_or_type_name
+		{ $$ = $1; $1->labels.emplace_back( yylloc, *$3 ); delete $3; }	// allocated by lexer
 	;
 
@@ -1967,5 +1975,6 @@
 
 declaration_list:
-	declaration
+	attribute_list_opt declaration
+		{ $$ = $2->addQualifiers( $1 ); }
 	| declaration_list declaration
 		{ $$ = $1->set_last( $2 ); }
@@ -2142,4 +2151,11 @@
 			} else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3
 		}
+	| TYPEDEF attribute_list type_specifier declarator
+		{
+			typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "typedef_declaration 1" );
+			if ( $3->type->forall || ($3->type->kind == TypeData::Aggregate && $3->type->aggregate.params) ) {
+				SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." ); $$ = nullptr;
+			} else $$ = $4->addType( $3 )->addTypedef()->addQualifiers( $2 ); // watchout frees $3 and $4
+		}
 	| typedef_declaration ',' declarator
 		{
@@ -2169,5 +2185,5 @@
 c_declaration:
 	declaration_specifier declaring_list
-		{ $$ = distAttr( $1, $2 ); }
+		{ $$ = distTypeSpec( $1, $2 ); }
 	| typedef_declaration
 	| typedef_expression								// deprecated GCC, naming expression type
@@ -2265,7 +2281,8 @@
 		// specifier-qualifier-list, either directly or via one or more typedefs, the behavior is the same as if it
 		// appeared only once.
-	type_qualifier
-	| type_qualifier_list type_qualifier
+	type_qualifier attribute_list_opt
 		{ $$ = $1->addQualifiers( $2 ); }
+	| type_qualifier_list type_qualifier attribute_list_opt
+		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
 	;
 
@@ -2273,5 +2290,4 @@
 	type_qualifier_name
 		{ $$ = DeclarationNode::newFromTypeData( $1 ); }
-	| attribute											// trick handles most attribute locations
 	;
 
@@ -2301,5 +2317,5 @@
 declaration_qualifier_list:
 	storage_class_list
-	| type_qualifier_list storage_class_list			// remaining OBSOLESCENT (see 2 )
+	| type_qualifier_list storage_class_list
 		{ $$ = $1->addQualifiers( $2 ); }
 	| declaration_qualifier_list type_qualifier_list storage_class_list
@@ -2313,7 +2329,8 @@
 		// ISO/IEC 9899:1999 Section 6.7.1(2) : At most, one storage-class specifier may be given in the declaration
 		// specifiers in a declaration.
-	storage_class
-	| storage_class_list storage_class
+	storage_class attribute_list_opt
 		{ $$ = $1->addQualifiers( $2 ); }
+	| storage_class_list storage_class attribute_list_opt
+		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
 	;
 
@@ -2440,6 +2457,6 @@
 	| declaration_qualifier_list basic_type_specifier
 		{ $$ = $2->addQualifiers( $1 ); }
-	| basic_declaration_specifier storage_class			// remaining OBSOLESCENT (see 2)
-		{ $$ = $1->addQualifiers( $2 ); }
+	| basic_declaration_specifier storage_class attribute_list_opt // remaining OBSOLESCENT (see 2)
+		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
 	| basic_declaration_specifier storage_class type_qualifier_list
 		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
@@ -2449,6 +2466,9 @@
 
 basic_type_specifier:
-	direct_type
+	direct_type attribute_list_opt
+		{ $$ = $1->addQualifiers( $2 ); }
 		// Cannot have type modifiers, e.g., short, long, etc.
+	| type_qualifier_list_opt indirect_type attribute_list
+		{ $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); }
 	| type_qualifier_list_opt indirect_type type_qualifier_list_opt
 		{ $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); }
@@ -2522,9 +2542,10 @@
 
 type_declaration_specifier:
-	type_type_specifier
-	| declaration_qualifier_list type_type_specifier
-		{ $$ = $2->addQualifiers( $1 ); }
-	| type_declaration_specifier storage_class			// remaining OBSOLESCENT (see 2)
+	type_type_specifier attribute_list_opt
 		{ $$ = $1->addQualifiers( $2 ); }
+	| declaration_qualifier_list type_type_specifier attribute_list_opt
+		{ $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); }
+	| type_declaration_specifier storage_class attribute_list_opt // remaining OBSOLESCENT (see 2)
+		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
 	| type_declaration_specifier storage_class type_qualifier_list
 		{ $$ = $1->addQualifiers( $2 )->addQualifiers( $3 ); }
@@ -2578,34 +2599,34 @@
 	aggregate_key attribute_list_opt
 		{ forall = false; }								// reset
-	  '{' field_declaration_list_opt '}' type_parameters_opt
-		{ $$ = DeclarationNode::newAggregate( $1, nullptr, $7, $5, true )->addQualifiers( $2 ); }
-	| aggregate_key attribute_list_opt identifier
+	  '{' field_declaration_list_opt '}' type_parameters_opt attribute_list_opt
+		{ $$ = DeclarationNode::newAggregate( $1, nullptr, $7, $5, true )->addQualifiers( $2 )->addQualifiers( $8 ); }
+	| aggregate_key attribute_list_opt identifier attribute_list_opt
 		{
 			typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname, "aggregate_type: 1" );
 			forall = false;								// reset
 		}
-	  '{' field_declaration_list_opt '}' type_parameters_opt
-		{
-			$$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 );
-		}
-	| aggregate_key attribute_list_opt TYPEDEFname		// unqualified type name
+	  '{' field_declaration_list_opt '}' type_parameters_opt attribute_list_opt
+		{
+			$$ = DeclarationNode::newAggregate( $1, $3, $9, $7, true )->addQualifiers( $2 )->addQualifiers( $4 )->addQualifiers( $10 );
+		}
+	| aggregate_key attribute_list_opt TYPEDEFname attribute_list_opt // unqualified type name
 		{
 			typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname, "aggregate_type: 2" );
 			forall = false;								// reset
 		}
-	  '{' field_declaration_list_opt '}' type_parameters_opt
+	  '{' field_declaration_list_opt '}' type_parameters_opt attribute_list_opt
 		{
 			DeclarationNode::newFromTypeData( build_typedef( $3 ) );
-			$$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 );
-		}
-	| aggregate_key attribute_list_opt TYPEGENname		// unqualified type name
+			$$ = DeclarationNode::newAggregate( $1, $3, $9, $7, true )->addQualifiers( $2 )->addQualifiers( $4 )->addQualifiers( $10 );
+		}
+	| aggregate_key attribute_list_opt TYPEGENname attribute_list_opt // unqualified type name
 		{
 			typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname, "aggregate_type: 3" );
 			forall = false;								// reset
 		}
-	  '{' field_declaration_list_opt '}' type_parameters_opt
+	  '{' field_declaration_list_opt '}' type_parameters_opt attribute_list_opt
 		{
 			DeclarationNode::newFromTypeData( build_type_gen( $3, nullptr ) );
-			$$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 );
+			$$ = DeclarationNode::newAggregate( $1, $3, $9, $7, true )->addQualifiers( $2 )->addQualifiers( $10 );
 		}
 	| aggregate_type_nobody
@@ -2686,15 +2707,13 @@
 
 field_declaration_list_opt:
-	// empty
+	// empty => struct S { /* no fields */ }; 
 		{ $$ = nullptr; }
-	| field_declaration_list_opt field_declaration
-		{ $$ = $1 ? $1->set_last( $2 ) : $2; }
+	| field_declaration_list_opt attribute_list_opt field_declaration
+		{ distAttr( $2, $3 ); $$ = $1 ? $1->set_last( $3 ) : $3; }
 	;
 
 field_declaration:
 	type_specifier field_declaring_list_opt ';'
-		{
-			$$ = fieldDecl( $1, $2 );
-		}
+		{ $$ = fieldDecl( $1, $2 ); }
 	| type_specifier field_declaring_list_opt '}'		// invalid syntax rule
 		{
@@ -2706,14 +2725,14 @@
 	| STATIC type_specifier field_declaring_list_opt ';' // CFA
 		{ SemanticError( yylloc, "STATIC aggregate field qualifier currently unimplemented." ); $$ = nullptr; }
-	| INLINE type_specifier field_abstract_list_opt ';'	// CFA
-		{
-			if ( ! $3 ) {								// field declarator ?
-				$3 = DeclarationNode::newName( nullptr );
+	| INLINE attribute_list_opt type_specifier field_abstract_list_opt ';'	// CFA
+		{
+			if ( ! $4 ) {								// field declarator ?
+				$4 = DeclarationNode::newName( nullptr );
 			} // if
-			$3->inLine = true;
-			$$ = distAttr( $2, $3 );					// mark all fields in list
-			distInl( $3 );
-		}
-	| INLINE aggregate_control ';'						// CFA
+			$4->inLine = true;
+			$$ = distTypeSpec( $3, $4 );				// mark all fields in list
+			distInl( $4 );
+		}
+	| INLINE attribute_list_opt aggregate_control ';'						// CFA
 		{ SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; }
 	| typedef_declaration ';'							// CFA
@@ -2721,6 +2740,6 @@
 	| EXTENSION cfa_field_declaring_list ';'			// GCC
 		{ distExt( $2 ); $$ = $2; }						// mark all fields in list
-	| INLINE cfa_field_abstract_list ';'				// CFA, new style field declaration
-		{ $$ = $2; }									// mark all fields in list
+	| INLINE attribute_list_opt cfa_field_abstract_list ';'	// CFA, new style field declaration
+		{ $$ = $3->addQualifiers( $2 ); }				// mark all fields in list
 	| cfa_typedef_declaration ';'						// CFA
 	| static_assert ';'									// C11
@@ -2762,6 +2781,5 @@
 
 field_abstract:
-		// 	no bit fields
-	variable_abstract_declarator
+	variable_abstract_declarator						// 	no bit fields
 	;
 
@@ -2796,12 +2814,12 @@
 enum_type:
 		// anonymous, no type name 
-	ENUM attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
+	ENUM attribute_list_opt hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt
 		{
 			if ( $3 == EnumHiding::Hide ) {
 				SemanticError( yylloc, "illegal syntax, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr;
 			} // if
-			$$ = DeclarationNode::newEnum( nullptr, $5, true, false )->addQualifiers( $2 );
-		}
-	| ENUM enumerator_type attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
+			$$ = DeclarationNode::newEnum( nullptr, $5, true, false )->addQualifiers( $2 )->addQualifiers( $8 );
+		}
+	| ENUM enumerator_type attribute_list_opt hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt
 		{
 			if ( $2 && ($2->storageClasses.val != 0 || $2->type->qualifiers.any()) ) {
@@ -2811,14 +2829,14 @@
 				SemanticError( yylloc, "illegal syntax, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr;
 			} // if
-			$$ = DeclarationNode::newEnum( nullptr, $6, true, true, $2 )->addQualifiers( $3 );
+			$$ = DeclarationNode::newEnum( nullptr, $6, true, true, $2 )->addQualifiers( $3 )->addQualifiers( $9 );
 		}
 
 		// named type
-	| ENUM attribute_list_opt identifier
+	| ENUM attribute_list_opt identifier attribute_list_opt
 		{ typedefTable.makeTypedef( *$3, "enum_type 1" ); }
-	  hide_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $3, $7, true, false, nullptr, $5 )->addQualifiers( $2 ); }
-	| 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 ); }
+	  hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt
+		{ $$ = DeclarationNode::newEnum( $3, $8, true, false, nullptr, $6 )->addQualifiers( $2 ->addQualifiers( $4 ))->addQualifiers( $11 ); }
+	| ENUM attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt // unqualified type name
+		{ $$ = DeclarationNode::newEnum( $3->name, $7, true, false, nullptr, $5 )->addQualifiers( $2 )->addQualifiers( $4 )->addQualifiers( $10 ); }
 	| ENUM enumerator_type attribute_list_opt identifier attribute_list_opt
 		{
@@ -2828,8 +2846,8 @@
 			typedefTable.makeTypedef( *$4, "enum_type 2" );
 		}
-	  hide_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $4, $9, true, true, $2, $7 )->addQualifiers( $3 )->addQualifiers( $5 ); }
-	| ENUM enumerator_type attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $4->name, $8, true, true, $2, $6 )->addQualifiers( $3 )->addQualifiers( $5 ); }
+	  hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt
+		{ $$ = DeclarationNode::newEnum( $4, $9, true, true, $2, $7 )->addQualifiers( $3 )->addQualifiers( $5 )->addQualifiers( $12 ); }
+	| ENUM enumerator_type attribute_list_opt typedef_name attribute_list_opt hide_opt '{' enumerator_list comma_opt '}' attribute_list_opt
+		{ $$ = DeclarationNode::newEnum( $4->name, $8, true, true, $2, $6 )->addQualifiers( $3 )->addQualifiers( $5 )->addQualifiers( $11 ); }
 
 		// forward declaration
@@ -2910,9 +2928,13 @@
 parameter_list:											// abstract + real
 	parameter_declaration
+	| attribute_list parameter_declaration
+		{ $$ = $2->addQualifiers( $1 ); }
 	| abstract_parameter_declaration
-	| parameter_list ',' parameter_declaration
-		{ $$ = $1->set_last( $3 ); }
-	| parameter_list ',' abstract_parameter_declaration
-		{ $$ = $1->set_last( $3 ); }
+	| attribute_list abstract_parameter_declaration
+		{ $$ = $2->addQualifiers( $1 ); }
+	| parameter_list ',' attribute_list_opt parameter_declaration
+		{ $4->addQualifiers( $3 ); $$ = $1->set_last( $4 ); }
+	| parameter_list ',' attribute_list_opt abstract_parameter_declaration
+		{ $4->addQualifiers( $3 ); $$ = $1->set_last( $4 ); }
 	;
 
@@ -3002,13 +3024,17 @@
 
 type_no_function:										// sizeof, alignof, cast (constructor)
-	cfa_abstract_declarator_tuple						// CFA
-	| type_specifier									// cannot be type_specifier_nobody, e.g., (struct S {}){} is a thing
+	type_specifier										// cannot be type_specifier_nobody, e.g., (struct S {}){} is a thing
 	| type_specifier abstract_declarator
 		{ $$ = $2->addType( $1 ); }
+	| cfa_abstract_declarator_tuple						// CFA
 	;
 
 type:													// typeof, assertion
 	type_no_function
+	| attribute_list type_no_function
+		{ $$ = $2->addQualifiers( $1 ); }
 	| cfa_abstract_function								// CFA
+	| attribute_list cfa_abstract_function				// CFA
+		{ $$ = $2->addQualifiers( $1 ); }
 	;
 
@@ -3268,15 +3294,15 @@
 	;
 
-external_definition_list:
-	push external_definition pop
-		{ $$ = $2; }
-	| external_definition_list push external_definition pop
-		{ $$ = $1 ? $1->set_last( $3 ) : $3; }
-	;
-
 external_definition_list_opt:
 	// empty
 		{ $$ = nullptr; }
 	| external_definition_list
+	;
+
+external_definition_list:
+	attribute_list_opt push external_definition pop
+		{ distAttr( $1, $3 ); $$ = $3; }
+	| external_definition_list attribute_list_opt push external_definition pop
+		{ distAttr( $2, $4 ); $$ = $1 ? $1->set_last( $4 ) : $4->addQualifiers( $2 ); }
 	;
 
@@ -3587,4 +3613,6 @@
 	ptrref_operator variable_declarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list variable_declarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list variable_declarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3651,4 +3679,6 @@
 	ptrref_operator function_declarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list function_declarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list function_declarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3703,4 +3733,6 @@
 	ptrref_operator KR_function_declarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list KR_function_declarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list KR_function_declarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3756,4 +3788,6 @@
 	ptrref_operator variable_type_redeclarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list variable_type_redeclarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list variable_type_redeclarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3820,4 +3854,6 @@
 	ptrref_operator function_type_redeclarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list function_type_redeclarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list function_type_redeclarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3864,4 +3900,6 @@
 	ptrref_operator identifier_parameter_declarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list identifier_parameter_declarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list identifier_parameter_declarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3922,4 +3960,6 @@
 	ptrref_operator type_parameter_redeclarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list type_parameter_redeclarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list type_parameter_redeclarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -3963,10 +4003,12 @@
 
 abstract_ptr:
-	ptrref_operator
-		{ $$ = DeclarationNode::newPointer( nullptr, $1 ); }
+	ptrref_operator attribute_list_opt
+		{ $$ = DeclarationNode::newPointer( nullptr, $1 )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list
 		{ $$ = DeclarationNode::newPointer( $2, $1 ); }
 	| ptrref_operator abstract_declarator
 		{ $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list abstract_declarator
+		{ $$ = $3->addPointer( DeclarationNode::newPointer( nullptr, $1 )->addQualifiers( $2 ) ); }
 	| ptrref_operator type_qualifier_list abstract_declarator
 		{ $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
@@ -4096,6 +4138,6 @@
 
 abstract_parameter_ptr:
-	ptrref_operator
-		{ $$ = DeclarationNode::newPointer( nullptr, $1 ); }
+	ptrref_operator attribute_list_opt
+		{ $$ = DeclarationNode::newPointer( nullptr, $1 )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list
 		{ $$ = DeclarationNode::newPointer( $2, $1 ); }
@@ -4175,6 +4217,6 @@
 
 variable_abstract_ptr:
-	ptrref_operator
-		{ $$ = DeclarationNode::newPointer( nullptr, $1 ); }
+	ptrref_operator attribute_list_opt
+		{ $$ = DeclarationNode::newPointer( nullptr, $1 )->addQualifiers( $2 ); }
 	| ptrref_operator type_qualifier_list
 		{ $$ = DeclarationNode::newPointer( $2, $1 ); }
@@ -4223,6 +4265,8 @@
 cfa_identifier_parameter_ptr:							// CFA
 		// No SUE declaration in parameter list.
-	ptrref_operator type_specifier_nobody
+ 	ptrref_operator type_specifier_nobody
 		{ $$ = $2->addNewPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list type_specifier_nobody
+		{ $$ = $3->addNewPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| type_qualifier_list ptrref_operator type_specifier_nobody
 		{ $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
@@ -4323,4 +4367,6 @@
 	ptrref_operator type_specifier
 		{ $$ = $2->addNewPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
+	| ptrref_operator attribute_list type_specifier
+		{ $$ = $3->addNewPointer( DeclarationNode::newPointer( nullptr, $1 ) )->addQualifiers( $2 ); }
 	| type_qualifier_list ptrref_operator type_specifier
 		{ $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
