Changeset daf1af8 for src/Parser
- Timestamp:
- Jun 8, 2017, 5:04:55 PM (8 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:
- cfaabe2c
- Parents:
- 28762a1
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/ParseNode.h ¶
r28762a1 rdaf1af8 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 15:42:18201713 // Update Count : 77 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 17 16:23:00 2017 13 // Update Count : 778 14 14 // 15 15 … … 393 393 Statement * build_return( ExpressionNode * ctl ); 394 394 Statement * build_throw( ExpressionNode * ctl ); 395 Statement * build_resume( ExpressionNode * ctl ); 396 Statement * build_resume_at( ExpressionNode * ctl , ExpressionNode * target ); 395 397 Statement * build_try( StatementNode * try_stmt, StatementNode * catch_stmt, StatementNode * finally_stmt ); 396 398 Statement * build_catch( DeclarationNode * decl, StatementNode * stmt, bool catchAny = false ); -
TabularUnified src/Parser/StatementNode.cc ¶
r28762a1 rdaf1af8 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 14:59:41 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Feb 2 22:16:40 201713 // Update Count : 32 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 8 16:16:00 2017 13 // Update Count : 328 14 14 // 15 15 … … 152 152 return new ReturnStmt( noLabels, exps.size() > 0 ? exps.back() : nullptr ); 153 153 } 154 154 155 Statement *build_throw( ExpressionNode *ctl ) { 155 156 std::list< Expression * > exps; 156 157 buildMoveList( ctl, exps ); 157 158 assertf( exps.size() < 2, "This means we are leaking memory"); 158 return new ReturnStmt( noLabels, !exps.empty() ? exps.back() : nullptr, true ); 159 return new ThrowStmt( noLabels, ThrowStmt::Terminate, !exps.empty() ? exps.back() : nullptr ); 160 } 161 162 Statement *build_resume( ExpressionNode *ctl ) { 163 std::list< Expression * > exps; 164 buildMoveList( ctl, exps ); 165 assertf( exps.size() < 2, "This means we are leaking memory"); 166 return new ThrowStmt( noLabels, ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr ); 167 } 168 169 Statement *build_resume_at( ExpressionNode *ctl, ExpressionNode *target ) { 170 std::list< Expression * > exps; 171 buildMoveList( ctl, exps ); 172 assertf( exps.size() < 2, "This means we are leaking memory"); 173 return new ThrowStmt( noLabels, ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr ); 159 174 } 160 175 -
TabularUnified src/Parser/parser.yy ¶
r28762a1 rdaf1af8 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu May 25 15:21:59201713 // Update Count : 239 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 25 16:58:00 2017 13 // Update Count : 2399 14 14 // 15 15 … … 931 931 { $$ = new StatementNode( build_throw( $2 ) ); } 932 932 | THROWRESUME assignment_expression_opt ';' // handles reresume 933 { $$ = new StatementNode( build_ throw( $2 ) ); }933 { $$ = new StatementNode( build_resume( $2 ) ); } 934 934 | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume 935 { $$ = new StatementNode( build_ throw( $2) ); }935 { $$ = new StatementNode( build_resume_at( $2, $4 ) ); } 936 936 ; 937 937
Note: See TracChangeset
for help on using the changeset viewer.