Changes in src/Parser/StatementNode.cc [4f147cc:ab57786]
- File:
-
- 1 edited
-
src/Parser/StatementNode.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
r4f147cc rab57786 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 15 20:47:11201613 // Update Count : 32 212 // Last Modified On : Sun Aug 21 11:59:37 2016 13 // Update Count : 325 14 14 // 15 15 … … 54 54 // find end of list and maintain previous pointer 55 55 for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) { 56 StatementNode *node = safe_dynamic_cast< StatementNode * >(curr); 56 StatementNode *node = dynamic_cast< StatementNode * >(curr); 57 assert( node ); 57 58 assert( dynamic_cast< CaseStmt * >(node->stmt.get()) ); 58 59 prev = curr; … … 137 138 } 138 139 139 Statement *build_branch( std::string identifier, BranchStmt::Type kind ) { 140 return new BranchStmt( noLabels, identifier, kind ); 140 Statement *build_branch( BranchStmt::Type kind ) { 141 Statement * ret = new BranchStmt( noLabels, "", kind ); 142 return ret; 143 } 144 Statement *build_branch( std::string *identifier, BranchStmt::Type kind ) { 145 Statement * ret = new BranchStmt( noLabels, *identifier, kind ); 146 delete identifier; // allocated by lexer 147 return ret; 141 148 } 142 149 Statement *build_computedgoto( ExpressionNode *ctl ) { … … 159 166 std::list< Statement * > branches; 160 167 buildMoveList< Statement, StatementNode >( catch_stmt, branches ); 161 CompoundStmt *tryBlock = safe_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt)); 168 CompoundStmt *tryBlock = dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt)); 169 assert( tryBlock ); 162 170 FinallyStmt *finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) ); 163 171 return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
Note:
See TracChangeset
for help on using the changeset viewer.