Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r1d4580a r4e06c1e  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 12 13:58:48 2016
    13 // Update Count     : 62
     12// Last Modified On : Tue Jul 12 17:52:32 2016
     13// Update Count     : 55
    1414//
    1515
     
    143143}
    144144
    145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
    146         Statement( _labels ), condition( _condition ), statements( _statements ) {
     145SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ):
     146        Statement( _labels ), condition( _condition ), branches( _branches ) {
    147147}
    148148
    149149SwitchStmt::SwitchStmt( const SwitchStmt & other ):
    150150        Statement( other ), condition( maybeClone( other.condition ) ) {
    151         cloneAll( other.statements, statements );
     151        cloneAll( other.branches, branches );
    152152}
    153153
    154154SwitchStmt::~SwitchStmt() {
    155155        delete condition;
    156         // destroy statements
    157 }
     156        // destroy branches
     157}
     158
     159void SwitchStmt::add_case( CaseStmt *c ) {}
    158160
    159161void SwitchStmt::print( std::ostream &os, int indent ) const {
     
    162164        os << endl;
    163165
    164         // statements
     166        // branches
    165167        std::list<Statement *>::const_iterator i;
    166         for ( i = statements.begin(); i != statements.end(); i++)
     168        for ( i = branches.begin(); i != branches.end(); i++)
    167169                (*i)->print( os, indent + 4 );
    168170
    169         //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os ));
     171        //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));
    170172}
    171173
     
    185187}
    186188
    187 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> stmts ) {
    188         return new CaseStmt( labels, 0, stmts, true );
     189CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) {
     190        return new CaseStmt( labels, 0, branches, true );
    189191}
    190192
     
    309311}
    310312
    311 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool catchAny ) :
    312         Statement( labels ), decl ( _decl ), body( _body ), catchRest ( catchAny ) {
     313CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool isCatchRest ) :
     314        Statement( labels ), decl ( _decl ), body( _body ), catchRest ( isCatchRest ) {
    313315}
    314316
Note: See TracChangeset for help on using the changeset viewer.