Ignore:
Timestamp:
Aug 25, 2017, 11:09:02 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
6b224a52
Parents:
3eab0ef6
Message:

First step for waitfor statments, does nothing but is there

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r3eab0ef6 r135b431  
    419419}
    420420
     421WaitForStmt::WaitForStmt( std::list<Label> labels ) : Statement( labels ) {
     422        timeout.time      = nullptr;
     423        timeout.statement = nullptr;
     424        timeout.condition = nullptr;
     425        orelse .statement = nullptr;
     426        orelse .condition = nullptr;
     427}
     428
     429WaitForStmt::WaitForStmt( const WaitForStmt & other ) : Statement( other ) {
     430        clauses.reserve( other.clauses.size() );
     431        for( auto & ocl : other.clauses ) {
     432                clauses.emplace_back();
     433                clauses.back().target.function = ocl.target.function->clone();
     434                cloneAll( ocl.target.arguments, clauses.back().target.arguments );
     435                clauses.back().statement = ocl.statement->clone();
     436                clauses.back().condition = ocl.condition->clone();
     437        }
     438
     439        timeout.time      = other.timeout.time     ->clone();
     440        timeout.statement = other.timeout.statement->clone();
     441        timeout.condition = other.timeout.condition->clone();
     442        orelse .statement = other.orelse .statement->clone();
     443        orelse .condition = other.orelse .condition->clone();
     444}
     445
     446WaitForStmt::~WaitForStmt() {
     447        for( auto & clause : clauses ) {
     448                delete clause.target.function;
     449                deleteAll( clause.target.arguments );
     450                delete clause.statement;
     451                delete clause.condition;
     452        }
     453
     454        delete timeout.time;
     455        delete timeout.statement;
     456        delete timeout.condition;
     457
     458        delete orelse.statement;
     459        delete orelse.condition;
     460}
     461
     462void WaitForStmt::print( std::ostream &os, int indent ) const {
     463        os << "Waitfor Statement" << endl;
     464        os << string( indent + 2, ' ' ) << "with block:" << endl;
     465        os << string( indent + 4, ' ' );
     466        // block->print( os, indent + 4 );
     467}
     468
    421469NullStmt::NullStmt( std::list<Label> labels ) : CompoundStmt( labels ) {}
    422470NullStmt::NullStmt() : CompoundStmt( std::list<Label>() ) {}
Note: See TracChangeset for help on using the changeset viewer.