[51587aa] | 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.h -- |
---|
| 8 | // |
---|
[843054c2] | 9 | // Author : Rodolfo G. Esteves |
---|
[51587aa] | 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:28:15 2015 |
---|
| 13 | // Update Count : 3 |
---|
| 14 | // |
---|
| 15 | |
---|
[51b7345] | 16 | #ifndef _FLATTEN_TUPLE_H_ |
---|
| 17 | #define _FLATTEN_TUPLE_H_ |
---|
| 18 | |
---|
| 19 | #include "SynTree/Mutator.h" |
---|
| 20 | #include "SynTree/Visitor.h" |
---|
| 21 | |
---|
| 22 | #include "SynTree/Expression.h" |
---|
| 23 | |
---|
| 24 | namespace Tuples { |
---|
[51587aa] | 25 | class FlattenTuple : public Mutator { |
---|
| 26 | typedef Mutator Parent; |
---|
| 27 | public: |
---|
| 28 | FlattenTuple(); |
---|
| 29 | ~FlattenTuple(); |
---|
[51b7345] | 30 | |
---|
[51587aa] | 31 | virtual Expression *mutate( TupleExpr *tupleExpr ); |
---|
| 32 | private: |
---|
| 33 | class CollectArgs : public Visitor { |
---|
| 34 | public: |
---|
| 35 | virtual void visit( UntypedExpr * ); |
---|
| 36 | virtual void visit( NameExpr * ); |
---|
| 37 | virtual void visit( CastExpr *); |
---|
| 38 | virtual void visit( AddressExpr * ); |
---|
| 39 | virtual void visit( UntypedMemberExpr * ); |
---|
| 40 | virtual void visit( MemberExpr * ); |
---|
| 41 | virtual void visit( VariableExpr * ); |
---|
| 42 | virtual void visit( ConstantExpr * ); |
---|
| 43 | virtual void visit( SizeofExpr * ); |
---|
| 44 | virtual void visit( AttrExpr * ); |
---|
| 45 | virtual void visit( LogicalExpr * ); |
---|
| 46 | virtual void visit( ConditionalExpr * ); |
---|
| 47 | virtual void visit( CommaExpr * ); |
---|
| 48 | virtual void visit( TypeExpr * ); |
---|
| 49 | virtual void visit( UntypedValofExpr * ); |
---|
| 50 | |
---|
| 51 | virtual void visit( TupleExpr *tupleExpr ); |
---|
[51b7345] | 52 | |
---|
[51587aa] | 53 | std::list< Expression *> &get_args() { return currentArgs; } |
---|
| 54 | private: |
---|
| 55 | std::list< Expression * > currentArgs; |
---|
| 56 | }; |
---|
| 57 | |
---|
| 58 | }; |
---|
| 59 | } // namespace Tuples |
---|
[51b7345] | 60 | |
---|
[51587aa] | 61 | #endif // _FLATTEN_TUPLE_H_ |
---|
[51b7345] | 62 | |
---|
[51587aa] | 63 | // Local Variables: // |
---|
| 64 | // tab-width: 4 // |
---|
| 65 | // mode: c++ // |
---|
| 66 | // compile-command: "make install" // |
---|
| 67 | // End: // |
---|