Changeset a32b204 for translator/Parser


Ignore:
Timestamp:
May 17, 2015, 1:19:35 PM (11 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

Location:
translator/Parser
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • translator/Parser/DeclarationNode.cc

    rb87a5ed ra32b204  
    531531                TypeData *prevBase = type;
    532532                TypeData *curBase = type->base;
    533                 while( curBase != 0 ) {
     533                while ( curBase != 0 ) {
    534534                        prevBase = curBase;
    535535                        curBase = curBase->base;
     
    591591        assert( a );
    592592        TypeData *cur = a;
    593         while( cur->base ) {
     593        while ( cur->base ) {
    594594                cur = cur->base;
    595595        }
     
    660660        DeclarationNode *newnode = new DeclarationNode;
    661661        TypeData *srcType = type;
    662         while( srcType->base ) {
     662        while ( srcType->base ) {
    663663                srcType = srcType->base;
    664664        }
     
    686686                if ( type ) {
    687687                        TypeData *srcType = type;
    688                         while( srcType->base ) {
     688                        while ( srcType->base ) {
    689689                                srcType = srcType->base;
    690690                        }
     
    763763        std::back_insert_iterator< std::list< Declaration* > > out( outputList );
    764764        const DeclarationNode *cur = firstNode;
    765         while( cur ) {
     765        while ( cur ) {
    766766                try {
    767767                        if ( DeclarationNode *extr = cur->extractAggregate() ) {
     
    790790        std::back_insert_iterator< std::list< DeclarationWithType* > > out( outputList );
    791791        const DeclarationNode *cur = firstNode;
    792         while( cur ) {
     792        while ( cur ) {
    793793                try {
    794794///       if ( DeclarationNode *extr = cur->extractAggregate() ) {
     
    827827        std::back_insert_iterator< std::list< Type* > > out( outputList );
    828828        const DeclarationNode *cur = firstNode;
    829         while( cur ) {
     829        while ( cur ) {
    830830                try {
    831831                        *out++ = cur->buildType();
  • translator/Parser/ExpressionNode.cc

    rb87a5ed ra32b204  
    120120                        int i = str.length() - 1;
    121121
    122                         while ( i >= 0 && !isxdigit( c = str.at( i--)) )
     122                        while ( i >= 0 && ! isxdigit( c = str.at( i--)) )
    123123                                sfx += c;
    124124
     
    371371                  case OperatorNode::OrAssn:
    372372                        // the rewrite rules for these expressions specify that the first argument has its address taken
    373                         assert( !args.empty() );
     373                        assert( ! args.empty() );
    374374                        args.front() = new AddressExpr( args.front() );
    375375                        break;
     
    490490                                VarRefNode *var = dynamic_cast<VarRefNode *>( get_args());
    491491                                assert( var );
    492                                 if ( !get_args()->get_link() ) {
     492                                if ( ! get_args()->get_link() ) {
    493493                                        return new AttrExpr( var->build(), ( Expression*)0);
    494494                                } else if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()->get_link()) ) {
  • translator/Parser/InitializerNode.cc

    rb87a5ed ra32b204  
    5656                        os << "designated by: (";
    5757                        ExpressionNode *curdes = designator;
    58                         while( curdes != 0) {
     58                        while ( curdes != 0) {
    5959                                curdes->printOneLine(os);
    6060                                curdes = (ExpressionNode *)(curdes->get_link());
  • translator/Parser/ParseNode.cc

    rb87a5ed ra32b204  
    5050    ParseNode *current = this;
    5151
    52     while( current->get_link() != 0 )
     52    while ( current->get_link() != 0 )
    5353        current = current->get_link();
    5454
  • translator/Parser/ParseNode.h

    rb87a5ed ra32b204  
    493493                cur = dynamic_cast< NodeType *>( cur->get_link() );
    494494        } // while
    495         if ( !errors.isEmpty() ) {
     495        if ( ! errors.isEmpty() ) {
    496496                throw errors;
    497497        } // if
  • translator/Parser/StatementNode.cc

    rb87a5ed ra32b204  
    171171void StatementNode::print( std::ostream &os, int indent ) const {
    172172        if ( labels != 0 )
    173                 if (!labels->empty()) {
     173                if (! labels->empty()) {
    174174                        std::list<std::string>::const_iterator i;
    175175
    176176                        os << '\r' << string( indent, ' ');
    177                         for( i = labels->begin(); i != labels->end(); i++ )
     177                        for ( i = labels->begin(); i != labels->end(); i++ )
    178178                                os << *i << ":";
    179179                        os << endl;
    180180                }
    181181
    182         switch( type ) {
     182        switch ( type ) {
    183183          case Decl:
    184184                decl->print( os, indent );
     
    232232        buildList<Statement, StatementNode>( get_block(), branches );
    233233
    234         switch( type ) {
     234        switch ( type ) {
    235235          case Decl:
    236236                return new DeclStmt( labs, maybeBuild< Declaration >( decl ) );
     
    251251                        thenb = branches.front();
    252252                        branches.pop_front();
    253                         if ( !branches.empty() ) {
     253                        if ( ! branches.empty() ) {
    254254                                elseb = branches.front();
    255255                                branches.pop_front();
  • translator/Parser/TypeData.cc

    rb87a5ed ra32b204  
    405405        switch ( kind ) {
    406406          case Aggregate:
    407                 if ( !toplevel && aggregate->members ) {
     407                if ( ! toplevel && aggregate->members ) {
    408408                        ret = clone();
    409409                        ret->qualifiers.clear();
     
    411411                break;
    412412          case Enum:
    413                 if ( !toplevel && enumeration->constants ) {
     413                if ( ! toplevel && enumeration->constants ) {
    414414                        ret = clone();
    415415                        ret->qualifiers.clear();
     
    556556
    557557        for ( std::list< DeclarationNode::BasicType >::const_iterator i = basic->typeSpec.begin(); i != basic->typeSpec.end(); ++i ) {
    558                 if ( !init ) {
     558                if ( ! init ) {
    559559                        init = true;
    560560                        if ( *i == DeclarationNode::Void ) {
    561                                 if ( basic->typeSpec.size() != 1 || !basic->modifiers.empty() ) {
     561                                if ( basic->typeSpec.size() != 1 || ! basic->modifiers.empty() ) {
    562562                                        throw SemanticError( "invalid type specifier \"void\" in type: ", this );
    563563                                } else {
     
    635635                switch ( *i ) {
    636636                  case DeclarationNode::Long:
    637                         if ( !init ) {
     637                        if ( ! init ) {
    638638                                init = true;
    639639                                ret = BasicType::LongSignedInt;
     
    667667                        break;
    668668                  case DeclarationNode::Short:
    669                         if ( !init ) {
     669                        if ( ! init ) {
    670670                                init = true;
    671671                                ret = BasicType::ShortSignedInt;
     
    684684                        break;
    685685                  case DeclarationNode::Signed:
    686                         if ( !init ) {
     686                        if ( ! init ) {
    687687                                init = true;
    688688                                ret = BasicType::SignedInt;
     
    709709                        break;
    710710                  case DeclarationNode::Unsigned:
    711                         if ( !init ) {
     711                        if ( ! init ) {
    712712                                init = true;
    713713                                ret = BasicType::UnsignedInt;
     
    744744
    745745        BasicType *bt;
    746         if ( !init ) {
     746        if ( ! init ) {
    747747                bt = new BasicType( buildQualifiers(), BasicType::SignedInt );
    748748        } else {
     
    781781        assert( kind == Function );
    782782        bool hasEllipsis = function->params ? function->params->get_hasEllipsis() : true;
    783         if ( !function->params ) hasEllipsis = !function->newStyle;
     783        if ( ! function->params ) hasEllipsis = ! function->newStyle;
    784784        FunctionType *ft = new FunctionType( buildQualifiers(), hasEllipsis );
    785785        buildList( function->params, ft->get_parameters() );
  • translator/Parser/TypedefTable.cc

    rb87a5ed ra32b204  
    6464                } else {
    6565                        list<Entry>::iterator listPos = (*curPos ).second.begin();
    66                         while( listPos != (*curPos ).second.end() && listPos->scope > scope ) {
     66                        while ( listPos != (*curPos ).second.end() && listPos->scope > scope ) {
    6767                                listPos++;
    6868                        }
     
    123123        for ( tableType::iterator i = table.begin(); i != table.end(); ) {
    124124                list<Entry> &declList = (*i ).second;
    125                 while (!declList.empty() && declList.front().scope == currentScope ) {
     125                while (! declList.empty() && declList.front().scope == currentScope ) {
    126126                        declList.pop_front();
    127127                }
Note: See TracChangeset for help on using the changeset viewer.