Changes in src/Parser/parser.yy [e307e12:9853d9b0]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
re307e12 r9853d9b0 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 7 10:43:44201913 // Update Count : 4 39412 // Last Modified On : Thu Dec 12 17:54:22 2019 13 // Update Count : 4404 14 14 // 15 15 … … 51 51 using namespace std; 52 52 53 #include "SynTree/Declaration.h" 53 54 #include "ParseNode.h" 54 55 #include "TypedefTable.h" … … 211 212 } // forCtrl 212 213 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 225 214 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? 226 215 … … 248 237 ExpressionNode * en; 249 238 DeclarationNode * decl; 250 DeclarationNode::Aggregate aggKey;239 AggregateDecl::Aggregate aggKey; 251 240 DeclarationNode::TypeClass tclass; 252 241 StatementNode * sn; … … 662 651 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 663 652 | postfix_expression '.' aggregate_control 664 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $3 ), $1 ) ); }653 { $$ = new ExpressionNode( build_keyword_cast( $3, $1 ) ); } 665 654 | postfix_expression ARROW identifier 666 655 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } … … 807 796 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 808 797 | '(' aggregate_control '&' ')' cast_expression // CFA 809 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $2 ), $5 ) ); }798 { $$ = new ExpressionNode( build_keyword_cast( $2, $5 ) ); } 810 799 // VIRTUAL cannot be opt because of look ahead issues 811 800 | '(' VIRTUAL ')' cast_expression // CFA … … 1201 1190 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1202 1191 OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1192 | '=' comma_expression // CFA 1193 { $$ = forCtrl( $2, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1194 OperKinds::LEThan, $2->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1203 1195 | comma_expression inclexcl comma_expression // CFA 1204 1196 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } … … 1208 1200 { $$ = forCtrl( $3, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1209 1201 OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1202 | comma_expression ';' '=' comma_expression // CFA 1203 { $$ = forCtrl( $4, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1204 OperKinds::LEThan, $4->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1210 1205 | comma_expression ';' comma_expression inclexcl comma_expression // CFA 1211 1206 { $$ = forCtrl( $3, $1, $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } … … 2071 2066 aggregate_data: 2072 2067 STRUCT 2073 { yyy = true; $$ = DeclarationNode::Struct; }2068 { yyy = true; $$ = AggregateDecl::Struct; } 2074 2069 | UNION 2075 { yyy = true; $$ = DeclarationNode::Union; }2070 { yyy = true; $$ = AggregateDecl::Union; } 2076 2071 | EXCEPTION // CFA 2077 { yyy = true; $$ = DeclarationNode::Exception; }2072 { yyy = true; $$ = AggregateDecl::Exception; } 2078 2073 ; 2079 2074 2080 2075 aggregate_control: // CFA 2081 2076 GENERATOR 2082 { yyy = true; $$ = DeclarationNode::Coroutine; }2077 { yyy = true; $$ = AggregateDecl::Coroutine; } 2083 2078 | COROUTINE 2084 { yyy = true; $$ = DeclarationNode::Coroutine; }2079 { yyy = true; $$ = AggregateDecl::Coroutine; } 2085 2080 | MONITOR 2086 { yyy = true; $$ = DeclarationNode::Monitor; }2081 { yyy = true; $$ = AggregateDecl::Monitor; } 2087 2082 | THREAD 2088 { yyy = true; $$ = DeclarationNode::Thread; }2083 { yyy = true; $$ = AggregateDecl::Thread; } 2089 2084 ; 2090 2085
Note:
See TracChangeset
for help on using the changeset viewer.