ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change
on this file since 3848e0e was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
initial commit
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[51b7345] | 1 | /* |
---|
| 2 | * This file is part of the Cforall project |
---|
| 3 | * |
---|
| 4 | * $Id: PolyMutator.h,v 1.8 2005/08/29 20:14:13 rcbilson Exp $ |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #ifndef GENPOLY_POLYMUTATOR_H |
---|
| 9 | #define GENPOLY_POLYMUTATOR_H |
---|
| 10 | |
---|
| 11 | #include <map> |
---|
| 12 | #include <string> |
---|
| 13 | #include <list> |
---|
| 14 | |
---|
| 15 | #include "GenPoly.h" |
---|
| 16 | |
---|
| 17 | #include "SynTree/SynTree.h" |
---|
| 18 | #include "SynTree/Declaration.h" |
---|
| 19 | #include "SynTree/Mutator.h" |
---|
| 20 | |
---|
| 21 | namespace GenPoly { |
---|
| 22 | |
---|
| 23 | class PolyMutator : public Mutator |
---|
| 24 | { |
---|
| 25 | public: |
---|
| 26 | PolyMutator(); |
---|
| 27 | |
---|
| 28 | virtual CompoundStmt* mutate(CompoundStmt *compoundStmt); |
---|
| 29 | virtual Statement* mutate(IfStmt *ifStmt); |
---|
| 30 | virtual Statement* mutate(WhileStmt *whileStmt); |
---|
| 31 | virtual Statement* mutate(ForStmt *forStmt); |
---|
| 32 | virtual Statement* mutate(SwitchStmt *switchStmt); |
---|
| 33 | virtual Statement* mutate(ChooseStmt *chooseStmt); |
---|
| 34 | virtual Statement* mutate(CaseStmt *caseStmt); |
---|
| 35 | virtual Statement* mutate(TryStmt *returnStmt); |
---|
| 36 | virtual Statement* mutate(CatchStmt *catchStmt); |
---|
| 37 | virtual Statement* mutate(ExprStmt *catchStmt); |
---|
| 38 | virtual Statement* mutate(ReturnStmt *catchStmt); |
---|
| 39 | |
---|
| 40 | virtual Expression* mutate(UntypedExpr *untypedExpr); |
---|
| 41 | |
---|
| 42 | // template method |
---|
| 43 | virtual void doEndScope() {} |
---|
| 44 | |
---|
| 45 | protected: |
---|
| 46 | void mutateStatementList( std::list< Statement* > &statements ); |
---|
| 47 | Statement* mutateStatement( Statement *stmt ); |
---|
| 48 | Expression* mutateExpression( Expression *expr ); |
---|
| 49 | static void makeTyVarMap( Type *type, TyVarMap &tyVarMap ); |
---|
| 50 | |
---|
| 51 | TyVarMap scopeTyVars; |
---|
| 52 | TypeSubstitution *env; |
---|
| 53 | std::list< Statement* > stmtsToAdd; |
---|
| 54 | std::list< Statement* > stmtsToAddAfter; |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | } // namespace |
---|
| 58 | |
---|
| 59 | #endif /* #ifndef GENPOLY_POLYMUTATOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.