Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/VarExprReplacer.h

    rc0b9f5d rc3b3799  
    2323class VariableExpr;
    2424
    25 namespace VarExprReplacer {
     25/// Visitor that replaces the declarations that VariableExprs refer to, according to the supplied mapping
     26class VarExprReplacer : public Visitor {
     27public:
    2628        typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap;
     29private:
     30        const DeclMap & declMap;
     31        bool debug;
     32public:
     33        VarExprReplacer( const DeclMap & declMap, bool debug = false );
    2734
    28         void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false );
    29 }
     35        // replace variable with new node from decl map
     36        virtual void visit( VariableExpr * varExpr );
     37
     38        static void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false ) {
     39                VarExprReplacer replacer( declMap, debug );
     40                maybeAccept( node, replacer );
     41        }
     42};
    3043
    3144// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.