source: src/GenPoly/PolyMutator.h @ ba407ce

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 ba407ce was 09f800b, checked in by Rob Schluntz <rschlunt@…>, 9 years ago

fix initializing object with result of polymorphic call

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[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
[09f800b]11// Last Modified By : Rob Schluntz
12// Last Modified On : Fri Aug 14 15:27:38 2015
13// Update Count     : 4
[51587aa]14//
[51b7345]15
[01aeade]16#ifndef _POLYMUTATOR_H
17#define _POLYMUTATOR_H
[51b7345]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
29namespace GenPoly {
[01aeade]30        class PolyMutator : public Mutator {
31          public:
32                PolyMutator();
[51b7345]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(ChooseStmt *chooseStmt);
40                virtual Statement* mutate(CaseStmt *caseStmt);
41                virtual Statement* mutate(TryStmt *returnStmt);
42                virtual Statement* mutate(CatchStmt *catchStmt);
43                virtual Statement* mutate(ExprStmt *catchStmt);
44                virtual Statement* mutate(ReturnStmt *catchStmt);
[51b7345]45 
[01aeade]46                virtual Expression* mutate(UntypedExpr *untypedExpr);
[09f800b]47
48                virtual Initializer* mutate(SingleInit *SingleInit);
49
[01aeade]50                // template method
51                virtual void doBeginScope() {}
52                virtual void doEndScope() {}
53          protected:
54                void mutateStatementList( std::list< Statement* > &statements );
55                Statement* mutateStatement( Statement *stmt );
56                Expression* mutateExpression( Expression *expr );
57                static void makeTyVarMap( Type *type, TyVarMap &tyVarMap );
[51b7345]58 
[01aeade]59                TyVarMap scopeTyVars;
60                TypeSubstitution *env;
61                std::list< Statement* > stmtsToAdd;
62                std::list< Statement* > stmtsToAddAfter;
63        };
[51b7345]64} // namespace
65
[01aeade]66#endif // _POLYMUTATOR_H
67
[51587aa]68// Local Variables: //
69// tab-width: 4 //
70// mode: c++ //
71// compile-command: "make install" //
72// End: //
Note: See TracBrowser for help on using the repository browser.