Changeset d63aeba
- Timestamp:
- Mar 22, 2023, 9:39:55 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 18ea270
- Parents:
- 5d9c4bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r5d9c4bb rd63aeba 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 21 19:01:00202313 // Update Count : 599012 // Last Modified On : Wed Mar 22 21:26:01 2023 13 // Update Count : 6002 14 14 // 15 15 … … 270 270 SemanticError( yylloc, ::toString( "Identifier \"", identifier, "\" cannot appear before a ", kind, ".\n" 271 271 "Possible cause is misspelled storage/CV qualifier, misspelled typename, or missing generic parameter." ) ); 272 } // IdentifierBeforeType 273 274 static bool TypedefForall( DeclarationNode * decl ) { 275 if ( decl->type->forall || (decl->type->kind == TypeData::Aggregate && decl->type->aggregate.params) ) { 276 SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." ); 277 return true; 278 } // if 279 return false; 272 280 } // IdentifierBeforeType 273 281 … … 1958 1966 TYPEDEF type_specifier declarator 1959 1967 { 1960 // if type_specifier is an anon aggregate => name1961 1968 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" ); 1962 $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 1969 if ( TypedefForall( $2 ) ) $$ = nullptr; 1970 else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 1963 1971 } 1964 1972 | typedef_declaration pop ',' push declarator … … 1970 1978 { 1971 1979 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" ); 1972 $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef(); 1980 if ( TypedefForall( $1 ) ) $$ = nullptr; 1981 else $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef(); 1973 1982 } 1974 1983 | type_specifier TYPEDEF declarator 1975 1984 { 1976 1985 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" ); 1977 $$ = $3->addType( $1 )->addTypedef(); 1986 if ( TypedefForall( $1 ) ) $$ = nullptr; 1987 else $$ = $3->addType( $1 )->addTypedef(); 1978 1988 } 1979 1989 | type_specifier TYPEDEF type_qualifier_list declarator 1980 1990 { 1981 1991 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" ); 1982 $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef(); 1992 if ( TypedefForall( $3 ) ) $$ = nullptr; 1993 else $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef(); 1983 1994 } 1984 1995 ;
Note: See TracChangeset
for help on using the changeset viewer.