Changeset 996c8ed for src/Parser/parser.yy
- Timestamp:
- Sep 26, 2022, 8:57:28 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 36cb4d9, f704974
- Parents:
- 160f1aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r160f1aa r996c8ed 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 27 13:21:28202213 // Update Count : 5 66112 // Last Modified On : Mon Sep 26 08:45:53 2022 13 // Update Count : 5704 14 14 // 15 15 … … 247 247 } // if 248 248 } // forCtrl 249 250 static void IdentifierBeforeIdentifier( string & identifier1, string & identifier2, const char * kind ) { 251 SemanticError( yylloc, ::toString( "Adjacent identifiers \"", identifier1, "\" and \"", identifier2, "\" are not meaningful in a", kind, ".\n" 252 "Possible cause is misspelled type name or missing generic parameter." ) ); 253 } // IdentifierBeforeIdentifier 254 255 static void IdentifierBeforeType( string & identifier, const char * kind ) { 256 SemanticError( yylloc, ::toString( "Identifier \"", identifier, "\" cannot appear before a ", kind, ".\n" 257 "Possible cause is misspelled storage/CV qualifier, misspelled typename, or missing generic parameter." ) ); 258 } // IdentifierBeforeType 249 259 250 260 bool forall = false; // aggregate have one or more forall qualifiers ? … … 651 661 // { SemanticError( yylloc, "Resume expression is currently unimplemented." ); $$ = nullptr; } 652 662 | IDENTIFIER IDENTIFIER // syntax error 653 { 654 SemanticError( yylloc, ::toString( "Adjacent identifiers are not meaningful in an expression. " 655 "Possible problem is identifier \"", *$1.str, 656 "\" is a misspelled typename or an incorrectly specified type name, " 657 "e.g., missing generic parameter or missing struct/union/enum before typename." ) ); 658 $$ = nullptr; 659 } 660 | IDENTIFIER direct_type // syntax error 661 { 662 SemanticError( yylloc, ::toString( "Identifier \"", *$1.str, "\" cannot appear before a type. " 663 "Possible problem is misspelled storage or CV qualifier." ) ); 664 $$ = nullptr; 665 } 663 { IdentifierBeforeIdentifier( *$1.str, *$2.str, "n expression" ); $$ = nullptr; } 664 | IDENTIFIER type_qualifier // syntax error 665 { IdentifierBeforeType( *$1.str, "type qualifier" ); $$ = nullptr; } 666 | IDENTIFIER storage_class // syntax error 667 { IdentifierBeforeType( *$1.str, "storage class" ); $$ = nullptr; } 668 | IDENTIFIER basic_type_name // syntax error 669 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 670 | IDENTIFIER TYPEDEFname // syntax error 671 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 672 | IDENTIFIER TYPEGENname // syntax error 673 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 666 674 ; 667 675 … … 2993 3001 { $$ = DeclarationNode::newDirectiveStmt( new StatementNode( build_directive( $1 ) ) ); } 2994 3002 | declaration 3003 | IDENTIFIER IDENTIFIER 3004 { IdentifierBeforeIdentifier( *$1.str, *$2.str, " declaration" ); $$ = nullptr; } 3005 | IDENTIFIER type_qualifier // syntax error 3006 { IdentifierBeforeType( *$1.str, "type qualifier" ); $$ = nullptr; } 3007 | IDENTIFIER storage_class // syntax error 3008 { IdentifierBeforeType( *$1.str, "storage class" ); $$ = nullptr; } 3009 | IDENTIFIER basic_type_name // syntax error 3010 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 3011 | IDENTIFIER TYPEDEFname // syntax error 3012 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 3013 | IDENTIFIER TYPEGENname // syntax error 3014 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 2995 3015 | external_function_definition 2996 3016 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown
Note: See TracChangeset
for help on using the changeset viewer.