Changes in src/SynTree/Mutator.cc [62423350:ce8c12f]
- File:
-
- 1 edited
-
src/SynTree/Mutator.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.cc
r62423350 rce8c12f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Jun 22 13:43:00201713 // Update Count : 2 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 30 16:45:19 2017 13 // Update Count : 22 14 14 // 15 15 … … 77 77 TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) { 78 78 handleNamedTypeDecl( typeDecl ); 79 typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) );80 79 return typeDecl; 81 80 } … … 153 152 } 154 153 155 Statement *Mutator::mutate( ThrowStmt *throwStmt ) {156 throwStmt->set_expr( maybeMutate( throwStmt->get_expr(), *this ) );157 throwStmt->set_target( maybeMutate( throwStmt->get_target(), *this ) );158 return throwStmt;159 }160 161 154 Statement *Mutator::mutate( TryStmt *tryStmt ) { 162 155 tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) ); 163 156 mutateAll( tryStmt->get_catchers(), *this ); 164 tryStmt->set_finally( maybeMutate( tryStmt->get_finally(), *this ) );165 157 return tryStmt; 166 158 } … … 168 160 Statement *Mutator::mutate( CatchStmt *catchStmt ) { 169 161 catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) ); 170 catchStmt->set_cond( maybeMutate( catchStmt->get_cond(), *this ) );171 162 catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) ); 172 163 return catchStmt; … … 382 373 } 383 374 375 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) { 376 valofExpr->set_env( maybeMutate( valofExpr->get_env(), *this ) ); 377 valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) ); 378 return valofExpr; 379 } 380 384 381 Expression *Mutator::mutate( RangeExpr *rangeExpr ) { 385 382 rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) ); … … 407 404 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); 408 405 tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) ); 406 return tupleExpr; 407 } 408 409 Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) { 410 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) ); 411 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); 412 tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) ); 413 tupleExpr->set_aggregate( maybeMutate( tupleExpr->get_aggregate(), *this ) ); 409 414 return tupleExpr; 410 415 } … … 433 438 } 434 439 435 Expression *Mutator::mutate( UntypedInitExpr * initExpr ) {436 initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) );437 initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) );438 initExpr->set_expr( maybeMutate( initExpr->get_expr(), *this ) );439 // not currently mutating initAlts, but this doesn't matter since this node is only used in the resolver.440 return initExpr;441 }442 443 Expression *Mutator::mutate( InitExpr * initExpr ) {444 initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) );445 initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) );446 initExpr->set_expr( maybeMutate( initExpr->get_expr(), *this ) );447 initExpr->set_designation( maybeMutate( initExpr->get_designation(), *this ) );448 return initExpr;449 }450 451 440 452 441 Type *Mutator::mutate( VoidType *voidType ) { … … 473 462 } 474 463 464 Type *Mutator::mutate( ReferenceType *refType ) { 465 mutateAll( refType->get_forall(), *this ); 466 refType->set_base( maybeMutate( refType->get_base(), *this ) ); 467 return refType; 468 } 469 475 470 Type *Mutator::mutate( FunctionType *functionType ) { 476 471 mutateAll( functionType->get_forall(), *this ); … … 515 510 mutateAll( tupleType->get_forall(), *this ); 516 511 mutateAll( tupleType->get_types(), *this ); 517 mutateAll( tupleType->get_members(), *this );518 512 return tupleType; 519 513 } … … 552 546 553 547 554 Designation *Mutator::mutate( Designation * designation ) {555 mutateAll( designation->get_designators(), *this );556 return designation;557 }558 559 548 Initializer *Mutator::mutate( SingleInit *singleInit ) { 560 549 singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) ); … … 563 552 564 553 Initializer *Mutator::mutate( ListInit *listInit ) { 565 mutateAll( listInit->get_designat ions(), *this );554 mutateAll( listInit->get_designators(), *this ); 566 555 mutateAll( listInit->get_initializers(), *this ); 567 556 return listInit;
Note:
See TracChangeset
for help on using the changeset viewer.