Changeset 86b8d16


Ignore:
Timestamp:
May 4, 2022, 6:31:34 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
8a5e357
Parents:
6825167
Message:

formatting, remove for/else shift/reduce conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r6825167 r86b8d16  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  4 14:25:20 2022
    13 // Update Count     : 5277
     12// Last Modified On : Wed May  4 17:22:48 2022
     13// Update Count     : 5279
    1414//
    1515
     
    12241224                { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); }
    12251225        | WHILE '(' ')' statement ELSE statement                        // CFA
    1226                 { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); SemanticWarning( yylloc, Warning::SuperfluousElse ); }
     1226                {
     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                }
    12271230        | WHILE '(' conditional_declaration ')' statement       %prec THEN
    12281231                { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); }
     
    12321235                { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); }
    12331236        | DO statement WHILE '(' ')' ELSE statement                     // CFA
    1234                 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); SemanticWarning( yylloc, Warning::SuperfluousElse ); }
    1235         | DO statement WHILE '(' comma_expression ')' ';'       %prec THEN
     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 ')' ';'
    12361242                { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); }
    12371243        | DO statement WHILE '(' comma_expression ')' ELSE statement // CFA
    12381244                { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ), $8 ) ); }
    1239         | FOR '(' ')' statement                                                         // CFA => for ( ;; )
     1245        | FOR '(' ')' statement                                                         %prec THEN // CFA => for ( ;; )
    12401246                { $$ = 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 ); }
     1247        | FOR '(' ')' statement ELSE statement                          // CFA
     1248                {
     1249                        $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) );
     1250                        SemanticWarning( yylloc, Warning::SuperfluousElse );
     1251                }
    12431252        | FOR '(' for_control_expression_list ')' statement     %prec THEN
    12441253                { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); }
Note: See TracChangeset for help on using the changeset viewer.