source: translator/ArgTweak/FunctionFixer.h @ 2c2242c

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 2c2242c was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#ifndef _DEFS_FUNCTION_FIXER_H_
2#define _DEFS_FUNCTION_FIXER_H_
3
4#include "SynTree/Mutator.h"
5#include "SymTab/Indexer.h"
6
7#include "SynTree/Expression.h"
8
9namespace ArgTweak {
10  class FunctionFixer : public Mutator
11  {
12    typedef Mutator Parent;
13
14  public:
15    FunctionFixer(SymTab::Indexer *ind = 0);
16    ~FunctionFixer();
17
18    virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
19    virtual Expression *mutate( UntypedExpr *untypedExpr ) throw ( SemanticError );
20
21  private:
22    class Matcher {
23      typedef std::string key;
24      typedef DeclarationWithType * pattern_type;
25      typedef Expression * permutation_type;
26    public:
27      static key null_key;
28      static permutation_type null_value;
29
30      std::string extract_key( DeclarationWithType * );
31      std::string extract_key( Expression * );
32
33      bool operator()( DeclarationWithType *, Expression * ) { return true; }
34    };
35
36    SymTab::Indexer *index;
37  };
38
39  template < class L1, class L2, class Predicate > bool align( L1 &pattern, L2 &possible_permutation, Predicate pred ); 
40
41} // namespace ArgTweak
42
43
44#endif // #ifndef _DEFS_FUNCTION_FIXER_H_
45
46/*
47  Local Variables:
48  mode: c++
49  End:
50*/
Note: See TracBrowser for help on using the repository browser.