Program Listing for File AstCombinedSimpleProcessing.h

Program Listing for File AstCombinedSimpleProcessing.h#

Return to documentation for file (src/midend/astProcessing/AstCombinedSimpleProcessing.h)

// Author: Gergo Barany
// $Id: AstCombinedSimpleProcessing.h,v 1.1 2008/01/08 02:56:38 dquinlan Exp $

// Class for combining AstSimpleProcessing traversals; see the comment in
// AstCombinedProcessing.h for general information.

#ifndef ASTCOMBINEDSIMPLEPROCESSING_H
#define ASTCOMBINEDSIMPLEPROCESSING_H

#include "AstSimpleProcessing.h"

class ROSE_DLL_API AstCombinedSimpleProcessing
    : public AstSimpleProcessing
{
public:
    typedef AstSimpleProcessing TraversalType;
    typedef TraversalType *TraversalPtr;
    typedef std::vector<TraversalPtr> TraversalPtrList;

    AstCombinedSimpleProcessing();
    AstCombinedSimpleProcessing(const TraversalPtrList &);

    void addTraversal(TraversalPtr);
    TraversalPtrList &get_traversalPtrListRef();

protected:
    virtual void visit(SgNode* astNode);

    virtual void atTraversalStart();
    virtual void atTraversalEnd();

    TraversalPtrList traversals;

private:
    TraversalPtrList::iterator tBegin, tEnd;
    TraversalPtrList::size_type numberOfTraversals;
};

class AstCombinedPrePostProcessing
    : public AstPrePostProcessing
{
public:
    typedef AstPrePostProcessing TraversalType;
    typedef TraversalType *TraversalPtr;
    typedef std::vector<TraversalPtr> TraversalPtrList;

    AstCombinedPrePostProcessing();
    AstCombinedPrePostProcessing(const TraversalPtrList &);

    void addTraversal(TraversalPtr);
    TraversalPtrList &get_traversalPtrListRef();

protected:
    virtual void preOrderVisit(SgNode* astNode);
    virtual void postOrderVisit(SgNode* astNode);

    virtual void atTraversalStart();
    virtual void atTraversalEnd();

    TraversalPtrList traversals;

private:
    TraversalPtrList::iterator tBegin, tEnd;
    TraversalPtrList::size_type numberOfTraversals;
};

#endif