Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Visitor.cc

    rce8c12f r62423350  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 30 16:45:25 2017
    13 // Update Count     : 24
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thu Jun 22 13:41:00 2017
     13// Update Count     : 26
    1414//
    1515
     
    6767void Visitor::visit( TypeDecl *typeDecl ) {
    6868        handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) );
     69        maybeAccept( typeDecl->get_init(), *this );
    6970}
    7071
     
    121122}
    122123
    123 void Visitor::visit( BranchStmt *branchStmt ) {
     124void Visitor::visit( __attribute__((unused)) BranchStmt *branchStmt ) {
    124125}
    125126
    126127void Visitor::visit( ReturnStmt *returnStmt ) {
    127128        maybeAccept( returnStmt->get_expr(), *this );
     129}
     130
     131void Visitor::visit( ThrowStmt * throwStmt ) {
     132        maybeAccept( throwStmt->get_expr(), *this );
     133        maybeAccept( throwStmt->get_target(), *this );
    128134}
    129135
     
    131137        maybeAccept( tryStmt->get_block(), *this );
    132138        acceptAll( tryStmt->get_catchers(), *this );
     139        maybeAccept( tryStmt->get_finally(), *this );
    133140}
    134141
    135142void Visitor::visit( CatchStmt *catchStmt ) {
    136143        maybeAccept( catchStmt->get_decl(), *this );
     144        maybeAccept( catchStmt->get_cond(), *this );
    137145        maybeAccept( catchStmt->get_body(), *this );
    138146}
     
    142150}
    143151
    144 void Visitor::visit( NullStmt *nullStmt ) {
     152void Visitor::visit( __attribute__((unused)) NullStmt *nullStmt ) {
    145153}
    146154
     
    295303}
    296304
    297 void Visitor::visit( UntypedValofExpr *valofExpr ) {
    298         maybeAccept( valofExpr->get_result(), *this );
    299         maybeAccept( valofExpr->get_body(), *this );
    300 }
    301 
    302305void Visitor::visit( RangeExpr *rangeExpr ) {
    303306        maybeAccept( rangeExpr->get_low(), *this );
     
    318321        maybeAccept( tupleExpr->get_result(), *this );
    319322        maybeAccept( tupleExpr->get_tuple(), *this );
    320 }
    321 
    322 void Visitor::visit( MemberTupleExpr *tupleExpr ) {
    323         maybeAccept( tupleExpr->get_result(), *this );
    324         maybeAccept( tupleExpr->get_member(), *this );
    325         maybeAccept( tupleExpr->get_aggregate(), *this );
    326323}
    327324
     
    343340}
    344341
     342void 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
     348void Visitor::visit( InitExpr * initExpr ) {
     349        maybeAccept( initExpr->get_result(), *this );
     350        maybeAccept( initExpr->get_expr(), *this );
     351        maybeAccept( initExpr->get_designation(), *this );
     352}
     353
    345354
    346355void Visitor::visit( VoidType *voidType ) {
     
    354363void Visitor::visit( PointerType *pointerType ) {
    355364        acceptAll( pointerType->get_forall(), *this );
    356         // xxx - should PointerType visit/mutate dimension?
    357365        maybeAccept( pointerType->get_base(), *this );
    358366}
     
    364372}
    365373
    366 void Visitor::visit( ReferenceType *refType ) {
    367         acceptAll( refType->get_forall(), *this );
    368         maybeAccept( refType->get_base(), *this );
    369 }
    370 
    371374void Visitor::visit( FunctionType *functionType ) {
    372375        acceptAll( functionType->get_forall(), *this );
     
    404407        acceptAll( tupleType->get_forall(), *this );
    405408        acceptAll( tupleType->get_types(), *this );
     409        acceptAll( tupleType->get_members(), *this );
    406410}
    407411
     
    433437}
    434438
     439void Visitor::visit( Designation * designation ) {
     440        acceptAll( designation->get_designators(), *this );
     441}
    435442
    436443void Visitor::visit( SingleInit *singleInit ) {
     
    439446
    440447void Visitor::visit( ListInit *listInit ) {
    441         acceptAll( listInit->get_designators(), *this );
     448        acceptAll( listInit->get_designations(), *this );
    442449        acceptAll( listInit->get_initializers(), *this );
    443450}
     
    450457
    451458
    452 void Visitor::visit( Subrange *subrange ) {}
    453 
    454 
    455 void Visitor::visit( Constant *constant ) {}
     459void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {}
     460
     461
     462void Visitor::visit( __attribute__((unused)) Constant *constant ) {}
    456463// Local Variables: //
    457464// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.