Changeset f80f840 for src/Parser/parser.yy
- Timestamp:
- Dec 10, 2019, 4:24:49 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2a3d446
- Parents:
- b798713 (diff), e307e12 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rb798713 rf80f840 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Aug 4 21:48:23201913 // Update Count : 43 6412 // Last Modified On : Sat Dec 7 10:43:44 2019 13 // Update Count : 4394 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 } // switch 221 return target; 222 } // Aggregate2Target 223 213 224 214 225 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? … … 365 376 %type<decl> abstract_parameter_declaration 366 377 367 %type<aggKey> aggregate_key 378 %type<aggKey> aggregate_key aggregate_data aggregate_control 368 379 %type<decl> aggregate_type aggregate_type_nobody 369 380 … … 650 661 | postfix_expression '.' '[' field_name_list ']' // CFA, tuple field selector 651 662 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 663 | postfix_expression '.' aggregate_control 664 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $3 ), $1 ) ); } 652 665 | postfix_expression ARROW identifier 653 666 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } … … 793 806 | '(' type_no_function ')' cast_expression 794 807 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 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 ) ); } 808 | '(' aggregate_control '&' ')' cast_expression // CFA 809 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $2 ), $5 ) ); } 804 810 // VIRTUAL cannot be opt because of look ahead issues 805 811 | '(' VIRTUAL ')' cast_expression // CFA … … 2059 2065 2060 2066 aggregate_key: 2067 aggregate_data 2068 | aggregate_control 2069 ; 2070 2071 aggregate_data: 2061 2072 STRUCT 2062 2073 { yyy = true; $$ = DeclarationNode::Struct; } 2063 2074 | UNION 2064 2075 { yyy = true; $$ = DeclarationNode::Union; } 2065 | EXCEPTION 2076 | EXCEPTION // CFA 2066 2077 { yyy = true; $$ = DeclarationNode::Exception; } 2067 | GENERATOR 2078 ; 2079 2080 aggregate_control: // CFA 2081 GENERATOR 2068 2082 { yyy = true; $$ = DeclarationNode::Coroutine; } 2069 2083 | COROUTINE … … 2096 2110 distInl( $3 ); 2097 2111 } 2112 | INLINE aggregate_control ';' // CFA 2113 { SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; } 2098 2114 | typedef_declaration ';' // CFA 2099 2115 | cfa_field_declaring_list ';' // CFA, new style field declaration
Note: See TracChangeset
for help on using the changeset viewer.