Changeset 4e7171f for src/Parser
- Timestamp:
- Feb 2, 2022, 1:45:19 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 17cb385, 6180274, 8cb149f
- Parents:
- ff3b0249
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
rff3b0249 r4e7171f 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // StatementNode.cc -- 7 // StatementNode.cc -- Transform from parse data-structures to AST data-structures, usually deleting the parse 8 // data-structure after the transformation. 8 9 // 9 10 // Author : Rodolfo G. Esteves 10 11 // Created On : Sat May 16 14:59:41 2015 11 12 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 2 09:45:28 202213 // Update Count : 4 1513 // Last Modified On : Wed Feb 2 12:27:58 2022 14 // Update Count : 424 14 15 // 15 16 … … 137 138 138 139 Statement * build_case( ExpressionNode * ctl ) { 139 return new CaseStmt( maybeMoveBuild< Expression >(ctl), list< Statement * >{} );140 return new CaseStmt( maybeMoveBuild< Expression >(ctl), {} ); // no init 140 141 } // build_case 141 142 142 143 Statement * build_default() { 143 return new CaseStmt( nullptr, list< Statement * >{}, true );144 return new CaseStmt( nullptr, {}, true ); // no init 144 145 } // build_default 145 146 … … 159 160 160 161 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt, StatementNode * else_ ) { 161 // do-while cannot have declarations in the contitional, so always empty162 list< Statement * > astinit;163 164 162 list< Statement * > aststmt; // loop body, compound created if empty 165 163 buildMoveList< Statement, StatementNode >( stmt, aststmt ); … … 169 167 buildMoveList< Statement, StatementNode >( else_, astelse ); 170 168 171 return new WhileDoStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), aststmt.front(), astelse.front(), astinit, true ); 169 // do-while cannot have declarations in the contitional, so init is always empty 170 return new WhileDoStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), aststmt.front(), astelse.front(), {}, true ); 172 171 } // build_do_while 173 172
Note:
See TracChangeset
for help on using the changeset viewer.