Changes in src/Parser/parser.yy [86b8d16:9e7236f4]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r86b8d16 r9e7236f4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 4 17:22:48202213 // Update Count : 527 912 // Last Modified On : Mon Mar 14 16:35:29 2022 13 // Update Count : 5276 14 14 // 15 15 … … 111 111 112 112 void distInl( DeclarationNode * declaration ) { 113 // distribute INLINEacross all declarations113 // distribute EXTENSION across all declarations 114 114 for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 115 115 iter->set_inLine( true ); … … 1221 1221 1222 1222 iteration_statement: 1223 WHILE '(' ')' statement %prec THEN// CFA => while ( 1 )1223 WHILE '(' ')' statement // CFA => while ( 1 ) 1224 1224 { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); } 1225 | WHILE '(' ')' statement ELSE statement // CFA1226 {1227 $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) );1228 SemanticWarning( yylloc, Warning::SuperfluousElse );1229 }1230 1225 | WHILE '(' conditional_declaration ')' statement %prec THEN 1231 1226 { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); } … … 1234 1229 | DO statement WHILE '(' ')' ';' // CFA => do while( 1 ) 1235 1230 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); } 1236 | DO statement WHILE '(' ')' ELSE statement // CFA 1237 { 1238 $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); 1239 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1240 } 1241 | DO statement WHILE '(' comma_expression ')' ';' 1231 | DO statement WHILE '(' comma_expression ')' ';' %prec THEN 1242 1232 { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); } 1243 1233 | DO statement WHILE '(' comma_expression ')' ELSE statement // CFA 1244 1234 { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ), $8 ) ); } 1245 | FOR '(' ')' statement %prec THEN// CFA => for ( ;; )1235 | FOR '(' ')' statement // CFA => for ( ;; ) 1246 1236 { $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); } 1247 | FOR '(' ')' statement ELSE statement // CFA1248 {1249 $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) );1250 SemanticWarning( yylloc, Warning::SuperfluousElse );1251 }1252 1237 | FOR '(' for_control_expression_list ')' statement %prec THEN 1253 1238 { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); } … … 2333 2318 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2334 2319 2335 $$ = DeclarationNode::newEnum( nullptr, $7, true, $3 ) ->addQualifiers( $5 );2320 $$ = DeclarationNode::newEnum( nullptr, $7, true, $3 ) ->addQualifiers( $5 ); 2336 2321 } 2337 2322 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt … … 2342 2327 '{' enumerator_list comma_opt '}' 2343 2328 { 2344 $$ = DeclarationNode::newEnum( $6, $10, true, $3 ) ->addQualifiers( $5 )->addQualifiers( $7 );2329 $$ = DeclarationNode::newEnum( $6, $10, true, $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2345 2330 } 2346 2331 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' … … 2348 2333 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2349 2334 typedefTable.makeTypedef( *$6->name ); 2350 $$ = DeclarationNode::newEnum( $6->name, $9, true, $3 ) ->addQualifiers( $5 )->addQualifiers( $7 );2335 $$ = DeclarationNode::newEnum( $6->name, $9, true, $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2351 2336 } 2352 2337 | enum_type_nobody
Note:
See TracChangeset
for help on using the changeset viewer.