Ignore:
Timestamp:
May 18, 2015, 11:45:33 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
01aeade
Parents:
0dd3a2f
Message:

licencing: fourth groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/Tuples/FlattenTuple.cc

    r0dd3a2f r51587aa  
     1//
     2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
     3//
     4// The contents of this file are covered under the licence agreement in the
     5// file "LICENCE" distributed with Cforall.
     6//
     7// FlattenTuple.cc --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Mon May 18 07:44:20 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon May 18 11:26:56 2015
     13// Update Count     : 1
     14//
     15
    116#include <list>
    217#include <vector>
     
    621#include "FlattenTuple.h"
    722
     23namespace Tuples {
     24        FlattenTuple::FlattenTuple() {
     25        }
    826
    9 namespace Tuples {
     27        FlattenTuple::~FlattenTuple() {
     28        }
    1029
    11   FlattenTuple::FlattenTuple()
    12   {
    13   }
     30        Expression *FlattenTuple::mutate( TupleExpr *tupleExpr ) {
     31                CollectArgs c;
    1432
    15   FlattenTuple::~FlattenTuple()
    16   {
    17   }
     33                acceptAll( tupleExpr->get_exprs(), c );
     34                tupleExpr->set_exprs( c.get_args() );
    1835
    19   Expression *FlattenTuple::mutate( TupleExpr *tupleExpr )
    20   {
    21     CollectArgs c;
     36                return tupleExpr;
     37        }
    2238
    23     acceptAll( tupleExpr->get_exprs(), c );
    24     tupleExpr->set_exprs( c.get_args() );
     39        void FlattenTuple::CollectArgs::visit( UntypedExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     40        void FlattenTuple::CollectArgs::visit( NameExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     41        void FlattenTuple::CollectArgs::visit( CastExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     42        void FlattenTuple::CollectArgs::visit( AddressExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     43        void FlattenTuple::CollectArgs::visit( UntypedMemberExpr *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     44        void FlattenTuple::CollectArgs::visit( MemberExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     45        void FlattenTuple::CollectArgs::visit( VariableExpr      *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     46        void FlattenTuple::CollectArgs::visit( ConstantExpr      *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     47        void FlattenTuple::CollectArgs::visit( SizeofExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     48        void FlattenTuple::CollectArgs::visit( AttrExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     49        void FlattenTuple::CollectArgs::visit( LogicalExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     50        void FlattenTuple::CollectArgs::visit( ConditionalExpr   *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     51        void FlattenTuple::CollectArgs::visit( CommaExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     52        void FlattenTuple::CollectArgs::visit( TypeExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
     53        void FlattenTuple::CollectArgs::visit( UntypedValofExpr  *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    2554
    26     return tupleExpr;
    27   }
     55        void FlattenTuple::CollectArgs::visit( TupleExpr *tupleExpr) {
     56                acceptAll( tupleExpr->get_exprs(), *this );
     57                //currentArgs.splice( currentArgs.end(), c.get_args() );
     58        }
     59} // namespace Tuples
    2860
    29   void FlattenTuple::CollectArgs::visit( UntypedExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    30   void FlattenTuple::CollectArgs::visit( NameExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    31   void FlattenTuple::CollectArgs::visit( CastExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    32   void FlattenTuple::CollectArgs::visit( AddressExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    33   void FlattenTuple::CollectArgs::visit( UntypedMemberExpr *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    34   void FlattenTuple::CollectArgs::visit( MemberExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    35   void FlattenTuple::CollectArgs::visit( VariableExpr      *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    36   void FlattenTuple::CollectArgs::visit( ConstantExpr      *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    37   void FlattenTuple::CollectArgs::visit( SizeofExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    38   void FlattenTuple::CollectArgs::visit( AttrExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    39   void FlattenTuple::CollectArgs::visit( LogicalExpr       *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    40   void FlattenTuple::CollectArgs::visit( ConditionalExpr   *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    41   void FlattenTuple::CollectArgs::visit( CommaExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    42   void FlattenTuple::CollectArgs::visit( TypeExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    43   void FlattenTuple::CollectArgs::visit( UntypedValofExpr  *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
    44 
    45   void FlattenTuple::CollectArgs::visit( TupleExpr *tupleExpr)
    46   {
    47     acceptAll( tupleExpr->get_exprs(), *this );
    48 
    49     //currentArgs.splice( currentArgs.end(), c.get_args() );
    50   }
    51 } // namespace Tuples
     61// Local Variables: //
     62// tab-width: 4 //
     63// mode: c++ //
     64// compile-command: "make install" //
     65// End: //
Note: See TracChangeset for help on using the changeset viewer.