Changeset a16764a6 for src/SynTree
- Timestamp:
- Feb 28, 2018, 4:48:22 PM (7 years ago)
- 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
- Location:
- src/SynTree
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r6a8df56 ra16764a6 93 93 return 0; 94 94 } 95 throwSemanticError( this, "Constant expression of non-integral type " );95 SemanticError( this, "Constant expression of non-integral type " ); 96 96 } 97 97 -
src/SynTree/Mutator.h
r6a8df56 ra16764a6 136 136 template< typename Container, typename MutatorType > 137 137 inline void mutateAll( Container &container, MutatorType &mutator ) { 138 SemanticError errors;138 SemanticErrorException errors; 139 139 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 140 140 try { … … 144 144 assert( *i ); 145 145 } // if 146 } catch( SemanticError &e ) {146 } catch( SemanticErrorException &e ) { 147 147 errors.append( e ); 148 148 } // try -
src/SynTree/Statement.cc
r6a8df56 ra16764a6 96 96 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 97 97 98 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticError ) :98 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticErrorException ) : 99 99 Statement(), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) { 100 100 //actually this is a syntactic error signaled by the parser 101 101 if ( type == BranchStmt::Goto && target.empty() ) { 102 throwSemanticError( 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 106 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticErrorException ) : 107 107 Statement(), computedTarget( computedTarget ), type( type ) { 108 108 if ( type != BranchStmt::Goto || computedTarget == nullptr ) { 109 throwSemanticError( computedTarget->location, "Computed target not valid in branch statement");109 SemanticError( computedTarget->location, "Computed target not valid in branch statement"); 110 110 } 111 111 } … … 201 201 } 202 202 203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticErrorException ) : 204 204 Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) { 205 if ( isDefault() && condition != 0 ) throwSemanticError( condition, "default case with condition: " );205 if ( isDefault() && condition != 0 ) SemanticError( condition, "default case with condition: " ); 206 206 } 207 207 -
src/SynTree/Statement.h
r6a8df56 ra16764a6 179 179 std::list<Statement *> stmts; 180 180 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); 182 182 CaseStmt( const CaseStmt &other ); 183 183 virtual ~CaseStmt(); … … 263 263 Type type; 264 264 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); 267 267 268 268 Label get_originalTarget() { return originalTarget; } -
src/SynTree/TypeSubstitution.h
r6a8df56 ra16764a6 98 98 } // if 99 99 } else { 100 throwSemanticError( 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 " ) ); 101 101 } // if 102 102 } else { -
src/SynTree/Visitor.h
r6a8df56 ra16764a6 132 132 template< typename Container, typename VisitorType > 133 133 inline void acceptAll( Container &container, VisitorType &visitor ) { 134 SemanticError errors;134 SemanticErrorException errors; 135 135 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 136 136 try { … … 138 138 (*i)->accept( visitor ); 139 139 } 140 } catch( SemanticError &e ) {140 } catch( SemanticErrorException &e ) { 141 141 errors.append( e ); 142 142 }
Note: See TracChangeset
for help on using the changeset viewer.