Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r62423350 rce8c12f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Jun 22 13:43:00 2017
    13 // Update Count     : 24
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Mar 30 16:45:19 2017
     13// Update Count     : 22
    1414//
    1515
     
    7777TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) {
    7878        handleNamedTypeDecl( typeDecl );
    79         typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) );
    8079        return typeDecl;
    8180}
     
    153152}
    154153
    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 
    161154Statement *Mutator::mutate( TryStmt *tryStmt ) {
    162155        tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
    163156        mutateAll( tryStmt->get_catchers(), *this );
    164         tryStmt->set_finally( maybeMutate( tryStmt->get_finally(), *this ) );
    165157        return tryStmt;
    166158}
     
    168160Statement *Mutator::mutate( CatchStmt *catchStmt ) {
    169161        catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
    170         catchStmt->set_cond( maybeMutate( catchStmt->get_cond(), *this ) );
    171162        catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) );
    172163        return catchStmt;
     
    382373}
    383374
     375Expression *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
    384381Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
    385382        rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) );
     
    407404        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    408405        tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) );
     406        return tupleExpr;
     407}
     408
     409Expression *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 ) );
    409414        return tupleExpr;
    410415}
     
    433438}
    434439
    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 
    451440
    452441Type *Mutator::mutate( VoidType *voidType ) {
     
    473462}
    474463
     464Type *Mutator::mutate( ReferenceType *refType ) {
     465        mutateAll( refType->get_forall(), *this );
     466        refType->set_base( maybeMutate( refType->get_base(), *this ) );
     467        return refType;
     468}
     469
    475470Type *Mutator::mutate( FunctionType *functionType ) {
    476471        mutateAll( functionType->get_forall(), *this );
     
    515510        mutateAll( tupleType->get_forall(), *this );
    516511        mutateAll( tupleType->get_types(), *this );
    517         mutateAll( tupleType->get_members(), *this );
    518512        return tupleType;
    519513}
     
    552546
    553547
    554 Designation *Mutator::mutate( Designation * designation ) {
    555         mutateAll( designation->get_designators(), *this );
    556         return designation;
    557 }
    558 
    559548Initializer *Mutator::mutate( SingleInit *singleInit ) {
    560549        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
     
    563552
    564553Initializer *Mutator::mutate( ListInit *listInit ) {
    565         mutateAll( listInit->get_designations(), *this );
     554        mutateAll( listInit->get_designators(), *this );
    566555        mutateAll( listInit->get_initializers(), *this );
    567556        return listInit;
Note: See TracChangeset for help on using the changeset viewer.