Changeset a16764a6 for src/SynTree/Statement.cc
- Timestamp:
- Feb 28, 2018, 4:48:22 PM (6 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.