Ignore:
Timestamp:
Jun 24, 2015, 4:04:19 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, string, with_gc
Children:
94e0864d
Parents:
a1d5d2a
Message:

fix computed goto, fixed -std=, implicit typedefs for enum and aggregates, add _Noreturn _Thread_local

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    ra1d5d2a rde62360d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun  5 07:51:04 2015
    13 // Update Count     : 15
     12// Last Modified On : Tue Jun 23 11:42:09 2015
     13// Update Count     : 21
    1414//
    1515
     
    3030Statement::Statement( std::list<Label> _labels ) : labels(_labels ) {}
    3131
    32 void Statement::print( std::ostream &, int indent ) {}
     32void Statement::print( std::ostream &, int indent ) const {}
    3333
    3434Statement::~Statement() {}
     
    3838ExprStmt::~ExprStmt() {}
    3939
    40 void ExprStmt::print( std::ostream &os, int indent ) {
     40void ExprStmt::print( std::ostream &os, int indent ) const {
    4141        os << string( indent, ' ' ) << "Expression Statement:" << endl;
    4242        expr->print( os, indent + 2 );
     
    5858}
    5959
    60 void BranchStmt::print( std::ostream &os, int indent ) {
     60void BranchStmt::print( std::ostream &os, int indent ) const {
    6161        os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ;
    6262}
     
    6868}
    6969
    70 void ReturnStmt::print( std::ostream &os, int indent ) {
     70void ReturnStmt::print( std::ostream &os, int indent ) const {
    7171        os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
    7272        if ( expr != 0 ) expr->print( os );
     
    7979IfStmt::~IfStmt() {}
    8080
    81 void IfStmt::print( std::ostream &os, int indent ) {
     81void IfStmt::print( std::ostream &os, int indent ) const {
    8282        os << string( indent, ' ' ) << "If on condition: " << endl ;
    8383        condition->print( os, indent + 4 );
     
    103103void SwitchStmt::add_case( CaseStmt *c ) {}
    104104
    105 void SwitchStmt::print( std::ostream &os, int indent ) {
     105void SwitchStmt::print( std::ostream &os, int indent ) const {
    106106        os << string( indent, ' ' ) << "Switch on condition: ";
    107107        condition->print( os );
     
    109109
    110110        // branches
    111         std::list<Statement *>::iterator i;
     111        std::list<Statement *>::const_iterator i;
    112112        for ( i = branches.begin(); i != branches.end(); i++)
    113                 (*i )->print( os, indent + 4 );
     113                (*i)->print( os, indent + 4 );
    114114
    115115        //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));
     
    130130}
    131131
    132 void CaseStmt::print( std::ostream &os, int indent ) {
     132void CaseStmt::print( std::ostream &os, int indent ) const {
    133133        os << string( indent, ' ' );
    134134
    135         if ( isDefault())
     135        if ( isDefault() )
    136136                os << "Default ";
    137137        else {
     
    142142        os << endl;
    143143
    144         std::list<Statement *>::iterator i;
     144        std::list<Statement *>::const_iterator i;
    145145        for ( i = stmts.begin(); i != stmts.end(); i++)
    146146                (*i )->print( os, indent + 4 );
     
    158158void ChooseStmt::add_case( CaseStmt *c ) {}
    159159
    160 void ChooseStmt::print( std::ostream &os, int indent ) {
     160void ChooseStmt::print( std::ostream &os, int indent ) const {
    161161        os << string( indent, ' ' ) << "Choose on condition: ";
    162162        condition->print( os );
     
    164164
    165165        // branches
    166         std::list<Statement *>::iterator i;
     166        std::list<Statement *>::const_iterator i;
    167167        for ( i = branches.begin(); i != branches.end(); i++)
    168168                (*i )->print( os, indent + 4 );
     
    171171}
    172172
    173 void FallthruStmt::print( std::ostream &os, int indent ) {
     173void FallthruStmt::print( std::ostream &os, int indent ) const {
    174174        os << string( indent, ' ' ) << "Fall-through statement" << endl;
    175175}
     
    183183}
    184184
    185 void WhileStmt::print( std::ostream &os, int indent ) {
     185void WhileStmt::print( std::ostream &os, int indent ) const {
    186186        os << string( indent, ' ' ) << "While on condition: " << endl ;
    187187        condition->print( os, indent + 4 );
     
    203203}
    204204
    205 void ForStmt::print( std::ostream &os, int indent ) {
     205void ForStmt::print( std::ostream &os, int indent ) const {
    206206        os << string( indent, ' ' ) << "Labels: {";
    207         for (std::list<Label>::iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
     207        for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
    208208                os << *it << ",";
    209209        }
     
    245245}
    246246
    247 void TryStmt::print( std::ostream &os, int indent ) {
     247void TryStmt::print( std::ostream &os, int indent ) const {
    248248        os << string( indent, ' ' ) << "Try Statement" << endl;
    249249        os << string( indent + 2, ' ' ) << "with block: " << endl;
     
    252252        // handlers
    253253        os << string( indent + 2, ' ' ) << "and handlers: " << endl;
    254         std::list<Statement *>::iterator i;
    255         for ( i = handlers.begin(); i != handlers.end(); i++)
     254        for ( std::list<Statement *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
    256255                (*i )->print( os, indent + 4 );
    257256
     
    272271}
    273272
    274 void CatchStmt::print( std::ostream &os, int indent ) {
     273void CatchStmt::print( std::ostream &os, int indent ) const {
    275274        os << string( indent, ' ' ) << "Catch Statement" << endl;
    276275
     
    294293}
    295294
    296 void FinallyStmt::print( std::ostream &os, int indent ) {
     295void FinallyStmt::print( std::ostream &os, int indent ) const {
    297296        os << string( indent, ' ' ) << "Finally Statement" << endl;
    298297        os << string( indent + 2, ' ' ) << "with block: " << endl;
     
    304303NullStmt::~NullStmt() {}
    305304
    306 void NullStmt::print( std::ostream &os, int indent ) {
     305void NullStmt::print( std::ostream &os, int indent ) const {
    307306        os << string( indent, ' ' ) << "Null Statement" << endl ;
    308307}
Note: See TracChangeset for help on using the changeset viewer.