Changeset 6825167 for src/Parser
- Timestamp:
- May 4, 2022, 5:12:47 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 86b8d16, f75e25b
- Parents:
- ec57856
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rec57856 r6825167 1224 1224 { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); } 1225 1225 | WHILE '(' ')' statement ELSE statement // CFA 1226 { SemanticWarning( yylloc, Warning::SuperfluousElse ); }1226 { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); SemanticWarning( yylloc, Warning::SuperfluousElse ); } 1227 1227 | WHILE '(' conditional_declaration ')' statement %prec THEN 1228 1228 { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); } … … 1232 1232 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); } 1233 1233 | DO statement WHILE '(' ')' ELSE statement // CFA 1234 { SemanticWarning( yylloc, Warning::SuperfluousElse ); }1234 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); SemanticWarning( yylloc, Warning::SuperfluousElse ); } 1235 1235 | DO statement WHILE '(' comma_expression ')' ';' %prec THEN 1236 1236 { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); } … … 1239 1239 | FOR '(' ')' statement // CFA => for ( ;; ) 1240 1240 { $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); } 1241 | FOR '(' ')' statement ELSE statement // CFA 1242 { $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); SemanticWarning( yylloc, Warning::SuperfluousElse ); } 1241 1243 | FOR '(' for_control_expression_list ')' statement %prec THEN 1242 1244 { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); }
Note: See TracChangeset
for help on using the changeset viewer.