Changes in src/Parser/parser.yy [e307e12:f1da02c]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
re307e12 rf1da02c 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Dec 7 10:43:44201913 // Update Count : 43 9412 // Last Modified On : Sun Aug 4 21:48:23 2019 13 // Update Count : 4364 14 14 // 15 15 … … 211 211 } // forCtrl 212 212 213 KeywordCastExpr::Target Aggregate2Target( DeclarationNode::Aggregate aggr ) {214 KeywordCastExpr::Target target;215 switch ( aggr ) {216 case DeclarationNode::Coroutine: target = KeywordCastExpr::Coroutine; break;217 case DeclarationNode::Monitor: target = KeywordCastExpr::Monitor; break;218 case DeclarationNode::Thread: target = KeywordCastExpr::Thread; break;219 default: abort();220 } // switch221 return target;222 } // Aggregate2Target223 224 213 225 214 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? … … 376 365 %type<decl> abstract_parameter_declaration 377 366 378 %type<aggKey> aggregate_key aggregate_data aggregate_control367 %type<aggKey> aggregate_key 379 368 %type<decl> aggregate_type aggregate_type_nobody 380 369 … … 661 650 | postfix_expression '.' '[' field_name_list ']' // CFA, tuple field selector 662 651 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 663 | postfix_expression '.' aggregate_control664 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $3 ), $1 ) ); }665 652 | postfix_expression ARROW identifier 666 653 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } … … 806 793 | '(' type_no_function ')' cast_expression 807 794 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 808 | '(' aggregate_control '&' ')' cast_expression // CFA 809 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $2 ), $5 ) ); } 795 // keyword cast cannot be grouped because of reduction in aggregate_key 796 | '(' GENERATOR '&' ')' cast_expression // CFA 797 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 798 | '(' COROUTINE '&' ')' cast_expression // CFA 799 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 800 | '(' THREAD '&' ')' cast_expression // CFA 801 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); } 802 | '(' MONITOR '&' ')' cast_expression // CFA 803 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); } 810 804 // VIRTUAL cannot be opt because of look ahead issues 811 805 | '(' VIRTUAL ')' cast_expression // CFA … … 1429 1423 asm_operand: // GCC 1430 1424 string_literal '(' constant_expression ')' 1431 { $$ = new ExpressionNode( new AsmExpr( nullptr, $1, maybeMoveBuild< Expression >( $3 ) ) ); }1432 | '[' IDENTIFIER']' string_literal '(' constant_expression ')'1433 { $$ = new ExpressionNode( new AsmExpr( $2, $4, maybeMoveBuild< Expression >( $6 ) ) ); }1425 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( (ExpressionNode *)nullptr ), $1, maybeMoveBuild< Expression >( $3 ) ) ); } 1426 | '[' constant_expression ']' string_literal '(' constant_expression ')' 1427 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( $2 ), $4, maybeMoveBuild< Expression >( $6 ) ) ); } 1434 1428 ; 1435 1429 … … 2065 2059 2066 2060 aggregate_key: 2067 aggregate_data2068 | aggregate_control2069 ;2070 2071 aggregate_data:2072 2061 STRUCT 2073 2062 { yyy = true; $$ = DeclarationNode::Struct; } 2074 2063 | UNION 2075 2064 { yyy = true; $$ = DeclarationNode::Union; } 2076 | EXCEPTION // CFA2065 | EXCEPTION 2077 2066 { yyy = true; $$ = DeclarationNode::Exception; } 2078 ; 2079 2080 aggregate_control: // CFA 2081 GENERATOR 2067 | GENERATOR 2082 2068 { yyy = true; $$ = DeclarationNode::Coroutine; } 2083 2069 | COROUTINE … … 2110 2096 distInl( $3 ); 2111 2097 } 2112 | INLINE aggregate_control ';' // CFA2113 { SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; }2114 2098 | typedef_declaration ';' // CFA 2115 2099 | cfa_field_declaring_list ';' // CFA, new style field declaration
Note:
See TracChangeset
for help on using the changeset viewer.