Ignore:
Timestamp:
Aug 4, 2016, 12:29:54 PM (8 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, 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:
76e8c55
Parents:
e80ebe5
Message:

move case-list management into parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    re80ebe5 r8688ce1  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 17:52:32 2016
    13 // Update Count     : 55
     12// Last Modified On : Thu Aug  4 11:25:20 2016
     13// Update Count     : 61
    1414//
    1515
     
    143143}
    144144
    145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ):
    146         Statement( _labels ), condition( _condition ), branches( _branches ) {
     145SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
     146        Statement( _labels ), condition( _condition ), statements( _statements ) {
    147147}
    148148
    149149SwitchStmt::SwitchStmt( const SwitchStmt & other ):
    150150        Statement( other ), condition( maybeClone( other.condition ) ) {
    151         cloneAll( other.branches, branches );
     151        cloneAll( other.statements, statements );
    152152}
    153153
    154154SwitchStmt::~SwitchStmt() {
    155155        delete condition;
    156         // destroy branches
    157 }
    158 
    159 void SwitchStmt::add_case( CaseStmt *c ) {}
     156        // destroy statements
     157}
    160158
    161159void SwitchStmt::print( std::ostream &os, int indent ) const {
     
    164162        os << endl;
    165163
    166         // branches
     164        // statements
    167165        std::list<Statement *>::const_iterator i;
    168         for ( i = branches.begin(); i != branches.end(); i++)
     166        for ( i = statements.begin(); i != statements.end(); i++)
    169167                (*i)->print( os, indent + 4 );
    170168
    171         //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));
     169        //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os ));
    172170}
    173171
     
    187185}
    188186
    189 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) {
    190         return new CaseStmt( labels, 0, branches, true );
     187CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> stmts ) {
     188        return new CaseStmt( labels, 0, stmts, true );
    191189}
    192190
Note: See TracChangeset for help on using the changeset viewer.