Changeset ac235a8
- Timestamp:
- Mar 29, 2023, 6:42:19 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- ff443e5
- Parents:
- 9fd9d015
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9fd9d015 rac235a8 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 29 1 1:21:38202313 // Update Count : 632 112 // Last Modified On : Wed Mar 29 17:56:42 2023 13 // Update Count : 6325 14 14 // 15 15 … … 271 271 SemanticError( yylloc, ::toString( "Identifier \"", identifier, "\" cannot appear before a ", kind, ".\n" 272 272 "Possible cause is misspelled storage/CV qualifier, misspelled typename, or missing generic parameter." ) ); 273 } // IdentifierBeforeType274 275 static bool TypedefForall( DeclarationNode * decl ) {276 if ( decl->type->forall || (decl->type->kind == TypeData::Aggregate && decl->type->aggregate.params) ) {277 SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." );278 return true;279 } // if280 return false;281 273 } // IdentifierBeforeType 282 274 … … 2019 2011 { 2020 2012 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" ); 2021 if ( TypedefForall( $2 ) ) $$ = nullptr; 2022 else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 2013 if ( $2->type->forall || ($2->type->kind == TypeData::Aggregate && $2->type->aggregate.params) ) { 2014 SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." ); $$ = nullptr; 2015 } else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 2023 2016 } 2024 2017 | typedef_declaration pop ',' push declarator … … 2028 2021 } 2029 2022 | type_qualifier_list TYPEDEF type_specifier declarator // remaining OBSOLESCENT (see 2 ) 2030 { 2031 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" ); 2032 if ( TypedefForall( $1 ) ) $$ = nullptr; 2033 else $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef(); 2034 } 2023 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 2035 2024 | type_specifier TYPEDEF declarator 2036 { 2037 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" ); 2038 if ( TypedefForall( $1 ) ) $$ = nullptr; 2039 else $$ = $3->addType( $1 )->addTypedef(); 2040 } 2025 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 2041 2026 | type_specifier TYPEDEF type_qualifier_list declarator 2042 { 2043 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" ); 2044 if ( TypedefForall( $3 ) ) $$ = nullptr; 2045 else $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef(); 2046 } 2027 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 2047 2028 ; 2048 2029 … … 2051 2032 TYPEDEF identifier '=' assignment_expression 2052 2033 { 2053 SemanticError( yylloc, "T ypedefexpression is deprecated, use typeof(...) instead." ); $$ = nullptr;2034 SemanticError( yylloc, "TYPEDEF expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 2054 2035 } 2055 2036 | typedef_expression pop ',' push identifier '=' assignment_expression 2056 2037 { 2057 SemanticError( yylloc, "T ypedefexpression is deprecated, use typeof(...) instead." ); $$ = nullptr;2038 SemanticError( yylloc, "TYPEDEF expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 2058 2039 } 2059 2040 ;
Note: See TracChangeset
for help on using the changeset viewer.