Changeset ca78437 for src/Parser
- Timestamp:
- Jun 12, 2017, 1:41:06 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:
- 465ed18
- Parents:
- cfaabe2c
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/ParseNode.h ¶
rcfaabe2c rca78437 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 17 16:23:00 201713 // Update Count : 77 812 // Last Modified On : Mon Jun 12 13:00:00 2017 13 // Update Count : 779 14 14 // 15 15 … … 396 396 Statement * build_resume_at( ExpressionNode * ctl , ExpressionNode * target ); 397 397 Statement * build_try( StatementNode * try_stmt, StatementNode * catch_stmt, StatementNode * finally_stmt ); 398 Statement * build_catch( DeclarationNode * decl, StatementNode * stmt, bool catchAny = false);398 Statement * build_catch( CatchStmt::Kind kind, DeclarationNode *decl, ExpressionNode *cond, StatementNode *body ); 399 399 Statement * build_finally( StatementNode * stmt ); 400 400 Statement * build_compound( StatementNode * first ); -
TabularUnified src/Parser/StatementNode.cc ¶
rcfaabe2c rca78437 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 8 16:16:00 201713 // Update Count : 32 812 // Last Modified On : Mon Jun 12 13:03:00 2017 13 // Update Count : 329 14 14 // 15 15 … … 181 181 return new TryStmt( noLabels, tryBlock, branches, finallyBlock ); 182 182 } 183 Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny ) {184 std::list< Statement * > branches; 185 buildMoveList< Statement, StatementNode >( stmt, branches );186 assert( branches.size() == 1 ); 187 return new CatchStmt( noLabels, maybeMoveBuild< Declaration >(decl), branches.front(), catchAny);183 Statement *build_catch( CatchStmt::Kind kind, DeclarationNode *decl, ExpressionNode *cond, StatementNode *body ) { 184 std::list< Statement * > branches; 185 buildMoveList< Statement, StatementNode >( body, branches ); 186 assert( branches.size() == 1 ); 187 return new CatchStmt( noLabels, kind, maybeMoveBuild< Declaration >(decl), maybeMoveBuild< Expression >(cond), branches.front() ); 188 188 } 189 189 Statement *build_finally( StatementNode *stmt ) { -
TabularUnified src/Parser/parser.yy ¶
rcfaabe2c rca78437 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 10 07:58:44201713 // Update Count : 240 112 // Last Modified On : Mon Jun 12 12:59:00 2017 13 // Update Count : 2402 14 14 // 15 15 … … 960 960 handler_clause: 961 961 CATCH '(' push push exception_declaration pop ')' compound_statement pop 962 { $$ = new StatementNode( build_catch( $5, $8 ) ); }962 { $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); } 963 963 | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop 964 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); }964 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Terminate, $6, nullptr, $9 ) ) ); } 965 965 | CATCHRESUME '(' push push exception_declaration pop ')' compound_statement pop 966 { $$ = new StatementNode( build_catch( $5, $8 ) ); }966 { $$ = new StatementNode( build_catch( CatchStmt::Resume, $5, nullptr, $8 ) ); } 967 967 | handler_clause CATCHRESUME '(' push push exception_declaration pop ')' compound_statement pop 968 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); }968 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Resume, $6, nullptr, $9 ) ) ); } 969 969 ; 970 970
Note: See TracChangeset
for help on using the changeset viewer.