Changeset e3b2474 for src/Parser/parser.yy
- Timestamp:
- Jul 3, 2018, 3:25:56 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 638ac26
- Parents:
- c653b37 (diff), bbe1a87 (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
rc653b37 re3b2474 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 24 10:41:10201813 // Update Count : 3 58712 // Last Modified On : Mon Jul 2 20:23:14 2018 13 // Update Count : 3607 14 14 // 15 15 … … 112 112 for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 113 113 iter->set_extension( true ); 114 } // for 115 } // distExt 116 117 void distQual( DeclarationNode * declaration, DeclarationNode * qualifiers ) { 118 // distribute qualifiers across all declarations in a distribution statemement 119 for ( DeclarationNode * iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 120 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 121 iter->addQualifiers( qualifiers->clone() ); 122 } // if 114 123 } // for 115 124 } // distExt … … 1136 1145 1137 1146 waitfor: 1138 WAITFOR '(' identifier ')' 1139 { 1140 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1141 delete $3; 1142 } 1143 | WAITFOR '(' identifier ',' argument_expression_list ')' 1144 { 1145 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1146 $$->set_last( $5 ); 1147 delete $3; 1148 } 1147 WAITFOR '(' cast_expression ')' 1148 { $$ = $3; } 1149 | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1150 { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1149 1151 ; 1150 1152 … … 1163 1165 { $$ = build_waitfor_timeout( nullptr, $3, $1 ); } 1164 1166 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1167 | when_clause_opt timeout statement WOR ELSE statement 1168 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1165 1169 | when_clause_opt timeout statement WOR when_clause ELSE statement 1166 1170 { $$ = build_waitfor_timeout( $2, $3, $1, $7, $5 ); } … … 2380 2384 '{' up external_definition_list_opt down '}' // CFA, namespace 2381 2385 { 2382 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2383 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2384 iter->addQualifiers( $1->clone() ); 2385 } // if 2386 } // for 2386 distQual( $5, $1 ); 2387 2387 xxx = false; 2388 2388 delete $1; … … 2391 2391 | declaration_qualifier_list 2392 2392 { 2393 if ( $1->type ->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); }2394 if ( $1->type ->forall ) xxx = forall = true; // remember generic type2393 if ( $1->type && $1->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2394 if ( $1->type && $1->type->forall ) xxx = forall = true; // remember generic type 2395 2395 } 2396 2396 '{' up external_definition_list_opt down '}' // CFA, namespace 2397 2397 { 2398 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2399 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2400 iter->addQualifiers( $1->clone() ); 2401 } // if 2402 } // for 2398 distQual( $5, $1 ); 2403 2399 xxx = false; 2404 2400 delete $1; … … 2412 2408 '{' up external_definition_list_opt down '}' // CFA, namespace 2413 2409 { 2414 for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2415 if ( isMangled( iter->linkage ) && isMangled( $2->linkage ) ) { // ignore extern "C" 2416 iter->addQualifiers( $1->clone() ); 2417 iter->addQualifiers( $2->clone() ); 2418 } // if 2419 } // for 2410 distQual( $6, $2 ); 2411 distQual( $6, $1 ); 2420 2412 xxx = false; 2421 2413 delete $1;
Note: See TracChangeset
for help on using the changeset viewer.