| [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 | // | 
|---|
| [01aeade] | 7 | // PolyMutator.h -- | 
|---|
| [51587aa] | 8 | // | 
|---|
|  | 9 | // Author           : Richard C. Bilson | 
|---|
|  | 10 | // Created On       : Mon May 18 07:44:20 2015 | 
|---|
| [4e06c1e] | 11 | // Last Modified By : Peter A. Buhr | 
|---|
|  | 12 | // Last Modified On : Tue Jul 12 17:39:41 2016 | 
|---|
|  | 13 | // Update Count     : 6 | 
|---|
| [51587aa] | 14 | // | 
|---|
| [51b73452] | 15 |  | 
|---|
| [01aeade] | 16 | #ifndef _POLYMUTATOR_H | 
|---|
|  | 17 | #define _POLYMUTATOR_H | 
|---|
| [51b73452] | 18 |  | 
|---|
|  | 19 | #include <map> | 
|---|
|  | 20 | #include <string> | 
|---|
|  | 21 | #include <list> | 
|---|
|  | 22 |  | 
|---|
|  | 23 | #include "GenPoly.h" | 
|---|
|  | 24 |  | 
|---|
|  | 25 | #include "SynTree/SynTree.h" | 
|---|
|  | 26 | #include "SynTree/Declaration.h" | 
|---|
|  | 27 | #include "SynTree/Mutator.h" | 
|---|
|  | 28 |  | 
|---|
|  | 29 | namespace GenPoly { | 
|---|
| [01aeade] | 30 | class PolyMutator : public Mutator { | 
|---|
|  | 31 | public: | 
|---|
|  | 32 | PolyMutator(); | 
|---|
| [51b73452] | 33 |  | 
|---|
| [01aeade] | 34 | virtual CompoundStmt* mutate(CompoundStmt *compoundStmt); | 
|---|
|  | 35 | virtual Statement* mutate(IfStmt *ifStmt); | 
|---|
|  | 36 | virtual Statement* mutate(WhileStmt *whileStmt); | 
|---|
|  | 37 | virtual Statement* mutate(ForStmt *forStmt); | 
|---|
|  | 38 | virtual Statement* mutate(SwitchStmt *switchStmt); | 
|---|
|  | 39 | virtual Statement* mutate(CaseStmt *caseStmt); | 
|---|
|  | 40 | virtual Statement* mutate(TryStmt *returnStmt); | 
|---|
|  | 41 | virtual Statement* mutate(CatchStmt *catchStmt); | 
|---|
|  | 42 | virtual Statement* mutate(ExprStmt *catchStmt); | 
|---|
|  | 43 | virtual Statement* mutate(ReturnStmt *catchStmt); | 
|---|
| [51b73452] | 44 |  | 
|---|
| [01aeade] | 45 | virtual Expression* mutate(UntypedExpr *untypedExpr); | 
|---|
| [09f800b] | 46 |  | 
|---|
|  | 47 | virtual Initializer* mutate(SingleInit *SingleInit); | 
|---|
|  | 48 |  | 
|---|
| [01aeade] | 49 | // template method | 
|---|
|  | 50 | virtual void doBeginScope() {} | 
|---|
|  | 51 | virtual void doEndScope() {} | 
|---|
|  | 52 | protected: | 
|---|
|  | 53 | void mutateStatementList( std::list< Statement* > &statements ); | 
|---|
|  | 54 | Statement* mutateStatement( Statement *stmt ); | 
|---|
|  | 55 | Expression* mutateExpression( Expression *expr ); | 
|---|
| [51b73452] | 56 |  | 
|---|
| [01aeade] | 57 | TyVarMap scopeTyVars; | 
|---|
|  | 58 | TypeSubstitution *env; | 
|---|
|  | 59 | std::list< Statement* > stmtsToAdd; | 
|---|
|  | 60 | std::list< Statement* > stmtsToAddAfter; | 
|---|
|  | 61 | }; | 
|---|
| [51b73452] | 62 | } // namespace | 
|---|
|  | 63 |  | 
|---|
| [01aeade] | 64 | #endif // _POLYMUTATOR_H | 
|---|
|  | 65 |  | 
|---|
| [51587aa] | 66 | // Local Variables: // | 
|---|
|  | 67 | // tab-width: 4 // | 
|---|
|  | 68 | // mode: c++ // | 
|---|
|  | 69 | // compile-command: "make install" // | 
|---|
|  | 70 | // End: // | 
|---|