Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r1b5c81ed rf80e0218  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Dec 09 14:09:34 2015
     12// Last Modified On : Thu May 12 13:33:18 2016
    1313// Update Count     : 54
    1414//
     
    4343
    4444void ExprStmt::print( std::ostream &os, int indent ) const {
    45         os << string( indent, ' ' ) << "Expression Statement:" << endl;
     45        os << "Expression Statement:" << endl << std::string( indent + 2, ' ' );
    4646        expr->print( os, indent + 2 );
    4747}
     
    8787        Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) {
    8888        //actually this is a syntactic error signaled by the parser
    89         if ( type == BranchStmt::Goto && target.size() == 0 )
     89        if ( type == BranchStmt::Goto && target.empty() )
    9090                throw SemanticError("goto without target");
    9191}
     
    110110
    111111void ReturnStmt::print( std::ostream &os, int indent ) const {
    112         os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
    113         if ( expr != 0 ) expr->print( os );
     112        os << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
     113        if ( expr != 0 ) {
     114                os << endl << string( indent+2, ' ' );
     115                expr->print( os, indent + 2 );
     116        }
    114117        os << endl;
    115118}
     
    124127
    125128void IfStmt::print( std::ostream &os, int indent ) const {
    126         os << string( indent, ' ' ) << "If on condition: " << endl ;
     129        os << "If on condition: " << endl ;
     130        os << string( indent+4, ' ' );
    127131        condition->print( os, indent + 4 );
    128132
    129         os << string( indent, ' ' ) << ".... and branches: " << endl;
    130 
     133        os << string( indent+2, ' ' ) << "... then: " << endl;
     134
     135        os << string( indent+4, ' ' );
    131136        thenPart->print( os, indent + 4 );
    132137
    133138        if ( elsePart != 0 ) {
     139                os << string( indent+2, ' ' ) << "... else: " << endl;
     140                os << string( indent+4, ' ' );
    134141                elsePart->print( os, indent + 4 );
    135142        } // if
     
    153160
    154161void SwitchStmt::print( std::ostream &os, int indent ) const {
    155         os << string( indent, ' ' ) << "Switch on condition: ";
     162        os << "Switch on condition: ";
    156163        condition->print( os );
    157164        os << endl;
     
    218225
    219226void ChooseStmt::print( std::ostream &os, int indent ) const {
    220         os << string( indent, ' ' ) << "Choose on condition: ";
     227        os << "Choose on condition: ";
    221228        condition->print( os );
    222229        os << endl;
     
    247254
    248255void WhileStmt::print( std::ostream &os, int indent ) const {
    249         os << string( indent, ' ' ) << "While on condition: " << endl ;
     256        os << "While on condition: " << endl ;
    250257        condition->print( os, indent + 4 );
    251258
     
    273280
    274281void ForStmt::print( std::ostream &os, int indent ) const {
    275         os << string( indent, ' ' ) << "Labels: {";
     282        os << "Labels: {";
    276283        for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
    277284                os << *it << ",";
     
    283290        os << string( indent + 2, ' ' ) << "initialization: \n";
    284291        for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     292                os << string( indent + 4, ' ' );
    285293                (*it)->print( os, indent + 4 );
    286294        }
    287295
    288296        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
    289         if ( condition != 0 )
     297        if ( condition != 0 ) {
     298                os << string( indent + 4, ' ' );
    290299                condition->print( os, indent + 4 );
     300        }
    291301
    292302        os << "\n" << string( indent + 2, ' ' ) << "increment: \n";
    293         if ( increment != 0 )
     303        if ( increment != 0 ) {
     304                os << string( indent + 4, ' ' );
    294305                increment->print( os, indent + 4 );
     306        }
    295307
    296308        os << "\n" << string( indent + 2, ' ' ) << "statement block: \n";
    297         if ( body != 0 )
     309        if ( body != 0 ) {
     310                os << string( indent + 4, ' ' );
    298311                body->print( os, indent + 4 );
     312        }
    299313
    300314        os << endl;
     
    314328
    315329void TryStmt::print( std::ostream &os, int indent ) const {
    316         os << string( indent, ' ' ) << "Try Statement" << endl;
     330        os << "Try Statement" << endl;
    317331        os << string( indent + 2, ' ' ) << "with block: " << endl;
    318332        block->print( os, indent + 4 );
     
    344358
    345359void CatchStmt::print( std::ostream &os, int indent ) const {
    346         os << string( indent, ' ' ) << "Catch Statement" << endl;
     360        os << "Catch Statement" << endl;
    347361
    348362        os << string( indent, ' ' ) << "... catching" << endl;
     
    369383
    370384void FinallyStmt::print( std::ostream &os, int indent ) const {
    371         os << string( indent, ' ' ) << "Finally Statement" << endl;
     385        os << "Finally Statement" << endl;
    372386        os << string( indent + 2, ' ' ) << "with block: " << endl;
    373387        block->print( os, indent + 4 );
     
    378392
    379393void NullStmt::print( std::ostream &os, int indent ) const {
    380         os << string( indent, ' ' ) << "Null Statement" << endl ;
     394        os << "Null Statement" << endl ;
     395}
     396
     397ImplicitCtorDtorStmt::ImplicitCtorDtorStmt( Statement * callStmt ) : Statement( std::list<Label>() ), callStmt( callStmt ) {
     398        assert( callStmt );
     399}
     400
     401ImplicitCtorDtorStmt::ImplicitCtorDtorStmt( const ImplicitCtorDtorStmt & other ) : Statement( other ), callStmt( maybeClone( other.callStmt ) ) {
     402}
     403
     404ImplicitCtorDtorStmt::~ImplicitCtorDtorStmt() {
     405        delete callStmt;
     406}
     407
     408void ImplicitCtorDtorStmt::print( std::ostream &os, int indent ) const {
     409        os << "Implicit Ctor Dtor Statement" << endl;
     410        os << string( indent + 2, ' ' ) << "with Ctor/Dtor: ";
     411        callStmt->print( os, indent + 2);
     412        os << endl;
    381413}
    382414
Note: See TracChangeset for help on using the changeset viewer.