PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CTreeMatcher Class Reference

#include <CTreeMatcher.h>

Inheritance diagram for Puma::CTreeMatcher:

Classes

struct  match_state

Public Types

enum  {
  ANY = 1 ,
  ANY_LIST ,
  MATCH_ALL ,
  MATCH_EXACT ,
  MATCH_FIRST ,
  MATCH_LAST ,
  MATCH_LEAF ,
  MATCH_PRUNE
}

Public Member Functions

 CTreeMatcher (unsigned int max=0)
 CTreeMatcher (CTree *matchTree, unsigned int max=0)
virtual ~CTreeMatcher ()
void init (CTree *matchTree, unsigned int max=0)
bool match (CTree *, CTree *, CMatch *) const
virtual void action (CMatch *match)
virtual bool correct (CTree *node)
virtual void match (CTranslationUnit &, CTranslationUnit &, CTree *=(CTree *) 0)
int matchTree (int, match_state &, CTree *, CTree *) const
int matchList (int, match_state &, CTree *, CTree *=(CTree *) 0, CTree *=(CTree *) 0) const
int matchNodeName (CTree *, CTree *) const
Public Member Functions inherited from Puma::CVisitor
 CVisitor ()
 Constructor.
virtual ~CVisitor ()
 Destructor.
void abort (bool v=true)
 Set the aborted state.
void prune (bool v=true)
 Set the pruned state (don't visit the sub-tree).
bool aborted () const
 Check if the node visiting is aborted.
bool pruned () const
 Check if the visiting the sub-tree is aborted.
void visit (CTree *node)
 Visit the given syntax tree node.
virtual void post_visit (CTree *node)
 Apply actions after the given node is visited.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ANY 
ANY_LIST 
MATCH_ALL 
MATCH_EXACT 
MATCH_FIRST 
MATCH_LAST 
MATCH_LEAF 
MATCH_PRUNE 

Constructor & Destructor Documentation

◆ CTreeMatcher() [1/2]

Puma::CTreeMatcher::CTreeMatcher ( unsigned int max = 0)
inline

◆ CTreeMatcher() [2/2]

Puma::CTreeMatcher::CTreeMatcher ( CTree * matchTree,
unsigned int max = 0 )
inline

◆ ~CTreeMatcher()

virtual Puma::CTreeMatcher::~CTreeMatcher ( )
inlinevirtual

Member Function Documentation

◆ action()

virtual void Puma::CTreeMatcher::action ( CMatch * match)
inlinevirtual

◆ correct()

virtual bool Puma::CTreeMatcher::correct ( CTree * node)
inlinevirtual

◆ init()

void Puma::CTreeMatcher::init ( CTree * matchTree,
unsigned int max = 0 )

◆ match() [1/2]

virtual void Puma::CTreeMatcher::match ( CTranslationUnit & ,
CTranslationUnit & ,
CTree * = (CTree *) 0 )
virtual

◆ match() [2/2]

bool Puma::CTreeMatcher::match ( CTree * ,
CTree * ,
CMatch *  ) const

◆ matchList()

int Puma::CTreeMatcher::matchList ( int ,
match_state & ,
CTree * ,
CTree * = (CTree *) 0,
CTree * = (CTree *) 0 ) const

◆ matchNodeName()

int Puma::CTreeMatcher::matchNodeName ( CTree * ,
CTree *  ) const

◆ matchTree()

int Puma::CTreeMatcher::matchTree ( int ,
match_state & ,
CTree * ,
CTree *  ) const