Changes in src/Parser/parser.yy [3ca7ef3:a491a3c]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r3ca7ef3 ra491a3c 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Oct 9 18:09:09202013 // Update Count : 4 61412 // Last Modified On : Thu May 28 12:11:45 2020 13 // Update Count : 4500 14 14 // 15 15 … … 204 204 return forCtrl( type, new string( identifier->name ), start, compop, comp, inc ); 205 205 } else { 206 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed ." ); return nullptr;206 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); return nullptr; 207 207 } // if 208 208 } else { 209 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed ." ); return nullptr;209 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); return nullptr; 210 210 } // if 211 211 } // forCtrl … … 278 278 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA 279 279 %token SIZEOF OFFSETOF 280 // %token RESUME // CFA281 %token SUSPEND // CFA280 // %token RESUME // CFA 281 %token SUSPEND // CFA 282 282 %token ATTRIBUTE EXTENSION // GCC 283 283 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN … … 329 329 %type<en> conditional_expression constant_expression assignment_expression assignment_expression_opt 330 330 %type<en> comma_expression comma_expression_opt 331 %type<en> argument_expression_list_opt argument_expression default_initialize_opt331 %type<en> argument_expression_list_opt argument_expression default_initialize_opt 332 332 %type<ifctl> if_control_expression 333 333 %type<fctl> for_control_expression for_control_expression_list … … 370 370 %type<decl> assertion assertion_list assertion_list_opt 371 371 372 %type<en> bit_subrange_size_opt bit_subrange_size372 %type<en> bit_subrange_size_opt bit_subrange_size 373 373 374 374 %type<decl> basic_declaration_specifier basic_type_name basic_type_specifier direct_type indirect_type … … 793 793 | '(' aggregate_control '&' ')' cast_expression // CFA 794 794 { $$ = new ExpressionNode( build_keyword_cast( $2, $5 ) ); } 795 // VIRTUAL cannot be opt because of look ahead issues 795 796 | '(' VIRTUAL ')' cast_expression // CFA 796 797 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr ) ) ); } … … 919 920 | unary_expression assignment_operator assignment_expression 920 921 { 921 //if ( $2 == OperKinds::AtAssn ) {922 //SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr;923 //} else {922 if ( $2 == OperKinds::AtAssn ) { 923 SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr; 924 } else { 924 925 $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); 925 //} // if926 } // if 926 927 } 927 928 | unary_expression '=' '{' initializer_list_opt comma_opt '}' … … 1675 1676 1676 1677 typedef_expression: 1677 // deprecatedGCC, naming expression type: typedef name = exp; gives a name to the type of an expression1678 // GCC, naming expression type: typedef name = exp; gives a name to the type of an expression 1678 1679 TYPEDEF identifier '=' assignment_expression 1679 1680 { 1680 SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 1681 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1682 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1681 1683 } 1682 1684 | typedef_expression pop ',' push identifier '=' assignment_expression 1683 1685 { 1684 SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 1685 } 1686 ; 1686 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1687 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1688 } 1689 ; 1690 1691 //c_declaration: 1692 // declaring_list pop ';' 1693 // | typedef_declaration pop ';' 1694 // | typedef_expression pop ';' // GCC, naming expression type 1695 // | sue_declaration_specifier pop ';' 1696 // ; 1697 // 1698 //declaring_list: 1699 // // A semantic check is required to ensure asm_name only appears on declarations with implicit or explicit static 1700 // // storage-class 1701 // declarator asm_name_opt initializer_opt 1702 // { 1703 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1704 // $$ = ( $2->addType( $1 ))->addAsmName( $3 )->addInitializer( $4 ); 1705 // } 1706 // | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt 1707 // { 1708 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1709 // $$ = $1->appendList( $1->cloneBaseType( $4->addAsmName( $5 )->addInitializer( $6 ) ) ); 1710 // } 1711 // ; 1687 1712 1688 1713 c_declaration: … … 1690 1715 { $$ = distAttr( $1, $2 ); } 1691 1716 | typedef_declaration 1692 | typedef_expression // deprecatedGCC, naming expression type1717 | typedef_expression // GCC, naming expression type 1693 1718 | sue_declaration_specifier 1694 1719 ; … … 2069 2094 { yyy = true; $$ = AggregateDecl::Union; } 2070 2095 | EXCEPTION // CFA 2071 // { yyy = true; $$ = AggregateDecl::Exception; } 2072 { SemanticError( yylloc, "exception aggregate is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2096 { yyy = true; $$ = AggregateDecl::Exception; } 2073 2097 ; 2074 2098 … … 2412 2436 // Overloading: function, data, and operator identifiers may be overloaded. 2413 2437 // 2414 // Type declarations: " otype" is used to generate new types for declaring objects. Similarly, "dtype" is used for object2438 // Type declarations: "type" is used to generate new types for declaring objects. Similarly, "dtype" is used for object 2415 2439 // and incomplete types, and "ftype" is used for function types. Type declarations with initializers provide 2416 2440 // definitions of new types. Type declarations with storage class "extern" provide opaque types. … … 2441 2465 type_class identifier_or_type_name 2442 2466 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2443 type_initializer_opt assertion_list_opt2467 type_initializer_opt assertion_list_opt 2444 2468 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2445 2469 | type_specifier identifier_parameter_declarator … … 2468 2492 assertion 2469 2493 | assertion_list assertion 2470 { $$ = $1 ->appendList( $2 ); }2494 { $$ = $1 ? $1->appendList( $2 ) : $2; } 2471 2495 ; 2472 2496
Note:
See TracChangeset
for help on using the changeset viewer.