Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Visitor.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:41:00 2017
    13 // Update Count     : 26
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Mar 30 16:45:25 2017
     13// Update Count     : 24
    1414//
    1515
     
    6767void Visitor::visit( TypeDecl *typeDecl ) {
    6868        handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) );
    69         maybeAccept( typeDecl->get_init(), *this );
    7069}
    7170
     
    122121}
    123122
    124 void Visitor::visit( __attribute__((unused)) BranchStmt *branchStmt ) {
     123void Visitor::visit( BranchStmt *branchStmt ) {
    125124}
    126125
    127126void Visitor::visit( ReturnStmt *returnStmt ) {
    128127        maybeAccept( returnStmt->get_expr(), *this );
    129 }
    130 
    131 void Visitor::visit( ThrowStmt * throwStmt ) {
    132         maybeAccept( throwStmt->get_expr(), *this );
    133         maybeAccept( throwStmt->get_target(), *this );
    134128}
    135129
     
    137131        maybeAccept( tryStmt->get_block(), *this );
    138132        acceptAll( tryStmt->get_catchers(), *this );
    139         maybeAccept( tryStmt->get_finally(), *this );
    140133}
    141134
    142135void Visitor::visit( CatchStmt *catchStmt ) {
    143136        maybeAccept( catchStmt->get_decl(), *this );
    144         maybeAccept( catchStmt->get_cond(), *this );
    145137        maybeAccept( catchStmt->get_body(), *this );
    146138}
     
    150142}
    151143
    152 void Visitor::visit( __attribute__((unused)) NullStmt *nullStmt ) {
     144void Visitor::visit( NullStmt *nullStmt ) {
    153145}
    154146
     
    303295}
    304296
     297void Visitor::visit( UntypedValofExpr *valofExpr ) {
     298        maybeAccept( valofExpr->get_result(), *this );
     299        maybeAccept( valofExpr->get_body(), *this );
     300}
     301
    305302void Visitor::visit( RangeExpr *rangeExpr ) {
    306303        maybeAccept( rangeExpr->get_low(), *this );
     
    321318        maybeAccept( tupleExpr->get_result(), *this );
    322319        maybeAccept( tupleExpr->get_tuple(), *this );
     320}
     321
     322void Visitor::visit( MemberTupleExpr *tupleExpr ) {
     323        maybeAccept( tupleExpr->get_result(), *this );
     324        maybeAccept( tupleExpr->get_member(), *this );
     325        maybeAccept( tupleExpr->get_aggregate(), *this );
    323326}
    324327
     
    340343}
    341344
    342 void Visitor::visit( UntypedInitExpr * initExpr ) {
    343         maybeAccept( initExpr->get_result(), *this );
    344         maybeAccept( initExpr->get_expr(), *this );
    345         // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
    346 }
    347 
    348 void Visitor::visit( InitExpr * initExpr ) {
    349         maybeAccept( initExpr->get_result(), *this );
    350         maybeAccept( initExpr->get_expr(), *this );
    351         maybeAccept( initExpr->get_designation(), *this );
    352 }
    353 
    354345
    355346void Visitor::visit( VoidType *voidType ) {
     
    363354void Visitor::visit( PointerType *pointerType ) {
    364355        acceptAll( pointerType->get_forall(), *this );
     356        // xxx - should PointerType visit/mutate dimension?
    365357        maybeAccept( pointerType->get_base(), *this );
    366358}
     
    372364}
    373365
     366void Visitor::visit( ReferenceType *refType ) {
     367        acceptAll( refType->get_forall(), *this );
     368        maybeAccept( refType->get_base(), *this );
     369}
     370
    374371void Visitor::visit( FunctionType *functionType ) {
    375372        acceptAll( functionType->get_forall(), *this );
     
    407404        acceptAll( tupleType->get_forall(), *this );
    408405        acceptAll( tupleType->get_types(), *this );
    409         acceptAll( tupleType->get_members(), *this );
    410406}
    411407
     
    437433}
    438434
    439 void Visitor::visit( Designation * designation ) {
    440         acceptAll( designation->get_designators(), *this );
    441 }
    442435
    443436void Visitor::visit( SingleInit *singleInit ) {
     
    446439
    447440void Visitor::visit( ListInit *listInit ) {
    448         acceptAll( listInit->get_designations(), *this );
     441        acceptAll( listInit->get_designators(), *this );
    449442        acceptAll( listInit->get_initializers(), *this );
    450443}
     
    457450
    458451
    459 void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {}
    460 
    461 
    462 void Visitor::visit( __attribute__((unused)) Constant *constant ) {}
     452void Visitor::visit( Subrange *subrange ) {}
     453
     454
     455void Visitor::visit( Constant *constant ) {}
    463456// Local Variables: //
    464457// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.