Changeset a16764a6 for src/SynTree


Ignore:
Timestamp:
Feb 28, 2018, 4:48:22 PM (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:
446ffa3
Parents:
6a8df56
Message:

Changed warning system to prepare for toggling warnings

Location:
src/SynTree
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r6a8df56 ra16764a6  
    9393                return 0;
    9494        }
    95         throw SemanticError( this, "Constant expression of non-integral type " );
     95        SemanticError( this, "Constant expression of non-integral type " );
    9696}
    9797
  • src/SynTree/Mutator.h

    r6a8df56 ra16764a6  
    136136template< typename Container, typename MutatorType >
    137137inline void mutateAll( Container &container, MutatorType &mutator ) {
    138         SemanticError errors;
     138        SemanticErrorException errors;
    139139        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    140140                try {
     
    144144                                assert( *i );
    145145                        } // if
    146                 } catch( SemanticError &e ) {
     146                } catch( SemanticErrorException &e ) {
    147147                        errors.append( e );
    148148                } // try
  • src/SynTree/Statement.cc

    r6a8df56 ra16764a6  
    9696const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" };
    9797
    98 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticError ) :
     98BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticErrorException ) :
    9999        Statement(), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) {
    100100        //actually this is a syntactic error signaled by the parser
    101101        if ( type == BranchStmt::Goto && target.empty() ) {
    102                 throw SemanticError( target.get_statement()->location, "goto without target");
    103         }
    104 }
    105 
    106 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticError ) :
     102                SemanticError( target.get_statement()->location, "goto without target");
     103        }
     104}
     105
     106BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticErrorException ) :
    107107        Statement(), computedTarget( computedTarget ), type( type ) {
    108108        if ( type != BranchStmt::Goto || computedTarget == nullptr ) {
    109                 throw SemanticError( computedTarget->location, "Computed target not valid in branch statement");
     109                SemanticError( computedTarget->location, "Computed target not valid in branch statement");
    110110        }
    111111}
     
    201201}
    202202
    203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
     203CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticErrorException ) :
    204204        Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) {
    205         if ( isDefault() && condition != 0 ) throw SemanticError( condition, "default case with condition: " );
     205        if ( isDefault() && condition != 0 ) SemanticError( condition, "default case with condition: " );
    206206}
    207207
  • src/SynTree/Statement.h

    r6a8df56 ra16764a6  
    179179        std::list<Statement *> stmts;
    180180
    181         CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
     181        CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException);
    182182        CaseStmt( const CaseStmt &other );
    183183        virtual ~CaseStmt();
     
    263263        Type type;
    264264
    265         BranchStmt( Label target, Type ) throw (SemanticError);
    266         BranchStmt( Expression *computedTarget, Type ) throw (SemanticError);
     265        BranchStmt( Label target, Type ) throw (SemanticErrorException);
     266        BranchStmt( Expression *computedTarget, Type ) throw (SemanticErrorException);
    267267
    268268        Label get_originalTarget() { return originalTarget; }
  • src/SynTree/TypeSubstitution.h

    r6a8df56 ra16764a6  
    9898                                } // if
    9999                        } else {
    100                                 throw SemanticError( formal, toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ) );
     100                                SemanticError( formal, toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ) );
    101101                        } // if
    102102                } else {
  • src/SynTree/Visitor.h

    r6a8df56 ra16764a6  
    132132template< typename Container, typename VisitorType >
    133133inline void acceptAll( Container &container, VisitorType &visitor ) {
    134         SemanticError errors;
     134        SemanticErrorException errors;
    135135        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    136136                try {
     
    138138                                (*i)->accept( visitor );
    139139                        }
    140                 } catch( SemanticError &e ) {
     140                } catch( SemanticErrorException &e ) {
    141141                        errors.append( e );
    142142                }
Note: See TracChangeset for help on using the changeset viewer.