Program Listing for File IfDirectiveExtractor.hh#
↰ Return to documentation for file (src/midend/programTransformation/astOutlining/IfDirectiveExtractor.hh)
#if !defined(INC_CPREPROC_IFDIRECTIVEEXTRACTOR_HH)
#define INC_CPREPROC_IFDIRECTIVEEXTRACTOR_HH
#include <stack>
#include <PrePostTraversal.hh>
#include <If.hh>
namespace CPreproc
{
class IfDirectiveExtractor : public ASTtools::PrePostTraversal
{
public:
IfDirectiveExtractor (Ifs_t& ifs);
virtual void visitTopDown (SgNode* n);
virtual void visitBottomUp (SgNode* n);
protected:
const If::Case* getCurrentContext (void) const;
If::Case* getCurrentContext (void);
private:
Ifs_t& ifs_;
std::stack<If *> pending_;
void validateNonEmptyStack (const PreprocessingInfo* info,
const SgLocatedNode* node) const;
void visit (SgNode* n, bool isTopDown);
void handleCase (PreprocessingInfo* info, SgLocatedNode* node);
void newIf (PreprocessingInfo* info, SgLocatedNode* node);
void addCase (PreprocessingInfo* info, SgLocatedNode* node);
static void checkLastCaseNotEndif (const If* i);
}; // class IfDirectiveExtractor
} // namespace CPreproc
#endif // !defined(INC_CPREPROC_IFDIRECTIVEEXTRACTOR_HH)
// eof