source: translator/GenPoly/PolyMutator.h @ b1a6d6b

aaron-thesisarm-ehcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since b1a6d6b was b1a6d6b, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

removed duplicate adapters, switch to c99 for initializer declarations

  • Property mode set to 100644
File size: 1.5 KB
Line 
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
21namespace GenPoly {
22
23class PolyMutator : public Mutator
24{
25public:
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 doBeginScope() {}
44  virtual void doEndScope() {}
45
46protected:
47  void mutateStatementList( std::list< Statement* > &statements );
48  Statement* mutateStatement( Statement *stmt );
49  Expression* mutateExpression( Expression *expr );
50  static void makeTyVarMap( Type *type, TyVarMap &tyVarMap );
51 
52  TyVarMap scopeTyVars;
53  TypeSubstitution *env;
54  std::list< Statement* > stmtsToAdd;
55  std::list< Statement* > stmtsToAddAfter;
56};
57
58} // namespace
59
60#endif /* #ifndef GENPOLY_POLYMUTATOR_H */
Note: See TracBrowser for help on using the repository browser.