Ignore:
Timestamp:
May 17, 2015, 1:19:35 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:
0dd3a2f
Parents:
b87a5ed
Message:

licencing: second groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/Statement.cc

    rb87a5ed ra32b204  
    3838{
    3939    //actually this is a syntactic error signaled by the parser
    40     if(type == BranchStmt::Goto && target.size() == 0)
     40    if (type == BranchStmt::Goto && target.size() == 0)
    4141        throw SemanticError("goto without target");
    4242}
     
    4646    Statement(labels), computedTarget(_computedTarget), type(_type)
    4747{
    48     if(type != BranchStmt::Goto || computedTarget == 0)
     48    if (type != BranchStmt::Goto || computedTarget == 0)
    4949        throw SemanticError("Computed target not valid in branch statement");
    5050}
     
    6363void ReturnStmt::print( std::ostream &os, int indent ){
    6464    os << "\r" << std::string(indent, ' ') << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
    65     if(expr != 0) expr->print(os);
     65    if (expr != 0) expr->print(os);
    6666    os << endl;
    6767}
     
    8181    thenPart->print(os, indent + 4);
    8282
    83     if(elsePart != 0){
     83    if (elsePart != 0){
    8484        elsePart->print(os, indent + 4);
    8585    }
     
    104104    // branches
    105105    std::list<Statement *>::iterator i;
    106     for(i = branches.begin(); i != branches.end(); i++)
     106    for (i = branches.begin(); i != branches.end(); i++)
    107107        (*i)->print(os, indent + 4);
    108108
     
    115115    Statement(_labels), condition(_condition), stmts(_statements), _isDefault(deflt)
    116116{
    117     if(isDefault() && condition != 0)
     117    if (isDefault() && condition != 0)
    118118        throw SemanticError("default with conditions");
    119119}
     
    126126    os << "\r" << string(indent, ' ');
    127127
    128     if(isDefault())
     128    if (isDefault())
    129129        os << "Default ";
    130130    else {
     
    136136
    137137    std::list<Statement *>::iterator i;
    138     for(i = stmts.begin(); i != stmts.end(); i++)
     138    for (i = stmts.begin(); i != stmts.end(); i++)
    139139        (*i)->print(os, indent + 4);
    140140}
     
    158158    // branches
    159159    std::list<Statement *>::iterator i;
    160     for(i = branches.begin(); i != branches.end(); i++)
     160    for (i = branches.begin(); i != branches.end(); i++)
    161161        (*i)->print(os, indent + 4);
    162162
     
    183183    os << string(indent, ' ') << ".... with body: " << endl;
    184184
    185     if(body != 0) body->print(os, indent + 4);
     185    if (body != 0) body->print(os, indent + 4);
    186186}
    187187
     
    216216
    217217    os << "\n\r" << string(indent + 2, ' ') << "statement block: \n";
    218     if(body != 0)
     218    if (body != 0)
    219219        body->print(os, indent + 4);
    220220
     
    244244    os << string(indent + 2, ' ') << "and handlers: " << endl;
    245245    std::list<Statement *>::iterator i;
    246     for(i = handlers.begin(); i != handlers.end(); i++)
     246    for (i = handlers.begin(); i != handlers.end(); i++)
    247247        (*i)->print(os, indent + 4);
    248248
     
    267267
    268268    os << "\r" << string(indent, ' ') << "... catching" << endl;
    269     if( decl ) {
     269    if ( decl ) {
    270270        decl->printShort( os, indent + 4 );
    271271        os << endl;
Note: See TracChangeset for help on using the changeset viewer.