Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r6cebfef r3b0bc16  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 12 19:00:42 2021
    13 // Update Count     : 536
     12// Last Modified On : Tue Feb  1 16:29:25 2022
     13// Update Count     : 540
    1414//
    1515#include "CodeGenerator.h"
     
    4242        bool wantSpacing( Statement * stmt) {
    4343                return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) ||
    44                         dynamic_cast< WhileStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );
     44                        dynamic_cast< WhileDoStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );
    4545        }
    4646
     
    955955                output << " ) ";
    956956
    957                 ifStmt->get_thenPart()->accept( *visitor );
    958 
    959                 if ( ifStmt->get_elsePart() != 0) {
     957                ifStmt->get_then()->accept( *visitor );
     958
     959                if ( ifStmt->get_else() != 0) {
    960960                        output << " else ";
    961                         ifStmt->get_elsePart()->accept( *visitor );
     961                        ifStmt->get_else()->accept( *visitor );
    962962                } // if
    963963        }
     
    11251125        }
    11261126
    1127         void CodeGenerator::postvisit( WhileStmt * whileStmt ) {
    1128                 if ( whileStmt->get_isDoWhile() ) {
     1127        void CodeGenerator::postvisit( WhileDoStmt * whileDoStmt ) {
     1128                if ( whileDoStmt->get_isDoWhile() ) {
    11291129                        output << "do";
    11301130                } else {
    11311131                        output << "while (";
    1132                         whileStmt->get_condition()->accept( *visitor );
     1132                        whileDoStmt->get_condition()->accept( *visitor );
    11331133                        output << ")";
    11341134                } // if
    11351135                output << " ";
    11361136
    1137                 output << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() );
    1138                 whileStmt->get_body()->accept( *visitor );
     1137                output << CodeGenerator::printLabels( whileDoStmt->get_body()->get_labels() );
     1138                whileDoStmt->get_body()->accept( *visitor );
    11391139
    11401140                output << indent;
    11411141
    1142                 if ( whileStmt->get_isDoWhile() ) {
     1142                if ( whileDoStmt->get_isDoWhile() ) {
    11431143                        output << " while (";
    1144                         whileStmt->get_condition()->accept( *visitor );
     1144                        whileDoStmt->get_condition()->accept( *visitor );
    11451145                        output << ");";
    11461146                } // if
Note: See TracChangeset for help on using the changeset viewer.