Ignore:
Timestamp:
Jun 12, 2017, 1:41:06 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
465ed18
Parents:
cfaabe2c
Message:

Updated the CatchStmt? node so that it may handle both termination and resumption.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    rcfaabe2c rca78437  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Jun 08 16:22:00 2017
    13 // Update Count     : 63
     12// Last Modified On : Mon Jun 12 10:37:00 2017
     13// Update Count     : 64
    1414//
    1515
     
    344344}
    345345
    346 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool catchAny ) :
    347         Statement( labels ), decl ( _decl ), body( _body ), catchRest ( catchAny ) {
     346CatchStmt::CatchStmt( std::list<Label> labels, Kind _kind, Declaration *_decl, Expression *_cond, Statement *_body ) :
     347        Statement( labels ), kind ( _kind ), decl ( _decl ), cond ( _cond ), body( _body ) {
    348348}
    349349
    350350CatchStmt::CatchStmt( const CatchStmt & other ) :
    351         Statement( other ), decl ( maybeClone( other.decl ) ), body( maybeClone( other.body ) ), catchRest ( other.catchRest ) {
     351        Statement( other ), kind ( other.kind ), decl ( maybeClone( other.decl ) ), cond ( maybeClone( other.cond ) ), body( maybeClone( other.body ) ) {
    352352}
    353353
     
    358358
    359359void CatchStmt::print( std::ostream &os, int indent ) const {
    360         os << "Catch Statement" << endl;
     360        os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
    361361
    362362        os << string( indent, ' ' ) << "... catching" << endl;
     
    364364                decl->printShort( os, indent + 4 );
    365365                os << endl;
    366         } else if ( catchRest )
    367                 os << string( indent + 4 , ' ' ) << "the rest" << endl;
     366        }
    368367        else
    369368                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
Note: See TracChangeset for help on using the changeset viewer.