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 | // |
---|
9 | // Author : Rodolfo G. Esteves |
---|
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 | |
---|
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 { |
---|
25 | class FlattenTuple : public Mutator { |
---|
26 | typedef Mutator Parent; |
---|
27 | public: |
---|
28 | FlattenTuple(); |
---|
29 | ~FlattenTuple(); |
---|
30 | |
---|
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( AlignofExpr * ); |
---|
45 | virtual void visit( UntypedOffsetofExpr * ); |
---|
46 | virtual void visit( OffsetofExpr * ); |
---|
47 | virtual void visit( OffsetPackExpr * ); |
---|
48 | virtual void visit( AttrExpr * ); |
---|
49 | virtual void visit( LogicalExpr * ); |
---|
50 | virtual void visit( ConditionalExpr * ); |
---|
51 | virtual void visit( CommaExpr * ); |
---|
52 | virtual void visit( TypeExpr * ); |
---|
53 | virtual void visit( UntypedValofExpr * ); |
---|
54 | |
---|
55 | virtual void visit( TupleExpr *tupleExpr ); |
---|
56 | |
---|
57 | std::list< Expression *> &get_args() { return currentArgs; } |
---|
58 | private: |
---|
59 | std::list< Expression * > currentArgs; |
---|
60 | }; |
---|
61 | |
---|
62 | }; |
---|
63 | } // namespace Tuples |
---|
64 | |
---|
65 | #endif // _FLATTEN_TUPLE_H_ |
---|
66 | |
---|
67 | // Local Variables: // |
---|
68 | // tab-width: 4 // |
---|
69 | // mode: c++ // |
---|
70 | // compile-command: "make install" // |
---|
71 | // End: // |
---|