Ignore:
Timestamp:
Aug 13, 2021, 3:58:19 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
de52331
Parents:
c9f9d4f
Message:

added mutex stmt monitor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    rc9f9d4f r6cebfef  
    565565}
    566566
     567MutexStmt::MutexStmt( Statement * stmt, std::list<Expression *> mutexObjs )
     568        : Statement(), stmt( stmt ), mutexObjs( mutexObjs ) { }
     569
     570MutexStmt::MutexStmt( const MutexStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) {
     571        cloneAll( other.mutexObjs, mutexObjs );
     572}
     573
     574MutexStmt::~MutexStmt() {
     575        deleteAll( mutexObjs );
     576        delete stmt;
     577}
     578
     579void MutexStmt::print( std::ostream & os, Indenter indent ) const {
     580        os << "Mutex Statement" << endl;
     581        os << indent << "... with Expressions: " << endl;
     582        for (auto * obj : mutexObjs) {
     583                os << indent+1;
     584                obj->print( os, indent+1);
     585                os << endl;
     586        }
     587        os << indent << "... with Statement: " << endl << indent+1;
     588        stmt->print( os, indent+1 );
     589}
     590
    567591// Local Variables: //
    568592// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.