Changes in src/SynTree/Statement.cc [d55d7a6:ba3706f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
rd55d7a6 rba3706f 100 100 //actually this is a syntactic error signaled by the parser 101 101 if ( type == BranchStmt::Goto && target.empty() ) { 102 throw SemanticError( target.get_statement()->location,"goto without target");102 throw SemanticError("goto without target"); 103 103 } 104 104 } … … 107 107 Statement(), computedTarget( computedTarget ), type( type ) { 108 108 if ( type != BranchStmt::Goto || computedTarget == nullptr ) { 109 throw SemanticError( computedTarget->location,"Computed target not valid in branch statement");109 throw SemanticError("Computed target not valid in branch statement"); 110 110 } 111 111 } … … 203 203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 204 204 Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) { 205 if ( isDefault() && condition != 0 ) throw SemanticError( condition, "default case with condition: ");205 if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition); 206 206 } 207 207 … … 456 456 } 457 457 458 459 WithStmt::WithStmt( const std::list< Expression * > & exprs, Statement * stmt ) : Statement(), exprs( exprs ), stmt( stmt ) {}460 WithStmt::WithStmt( const WithStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) {461 cloneAll( other.exprs, exprs );462 }463 WithStmt::~WithStmt() {464 deleteAll( exprs );465 delete stmt;466 }467 468 void WithStmt::print( std::ostream & os, Indenter indent ) const {469 os << "With statement" << endl;470 os << indent << "... with statement:" << endl << indent+1;471 stmt->print( os, indent+1 );472 }473 474 475 458 NullStmt::NullStmt( const std::list<Label> & labels ) : Statement( labels ) { 476 459 }
Note:
See TracChangeset
for help on using the changeset viewer.