IDA C++ SDK 9.2
|
A generic helper class that is used for ctree traversal. More...
#include <hexrays.hpp>
Public Member Functions | |
bool | maintain_parents () const |
Should the parent information by maintained? | |
bool | must_prune () const |
Should the traversal skip the children of the current item? | |
bool | must_restart () const |
Should the traversal restart? | |
bool | is_postorder () const |
Should the leave...() functions be called? | |
bool | only_insns () const |
Should all expressions be automatically pruned? | |
void | prune_now () |
Prune children. | |
void | clr_prune () |
Do not prune children. This is an internal function, no need to call it. | |
void | set_restart () |
Restart the travesal. Meaningful only in apply_to_exprs() | |
void | clr_restart () |
Do not restart. This is an internal function, no need to call it. | |
ctree_visitor_t (int _flags) | |
Constructor. | |
virtual | ~ctree_visitor_t () |
int hexapi | apply_to (citem_t *item, citem_t *parent) |
Traverse ctree. | |
int hexapi | apply_to_exprs (citem_t *item, citem_t *parent) |
Traverse only expressions. | |
citem_t * | parent_item () |
Get parent of the current item as an item (statement or expression) | |
cexpr_t * | parent_expr () |
Get parent of the current item as an expression. | |
cinsn_t * | parent_insn () |
Get parent of the current item as a statement. | |
virtual int idaapi | visit_insn (cinsn_t *) |
Visit a statement. | |
virtual int idaapi | visit_expr (cexpr_t *) |
Visit an expression. | |
virtual int idaapi | leave_insn (cinsn_t *) |
Visit a statement after having visited its children. | |
virtual int idaapi | leave_expr (cexpr_t *) |
Visit an expression after having visited its children. |
Public Attributes | |
int | cv_flags |
Ctree visitor property bits | |
parents_t | parents |
Vector of parents of the current item. | |
cblock_posvec_t | bposvec |
Vector of block positions. |
A generic helper class that is used for ctree traversal.
When traversing the ctree, the currently visited ctree item and its children can be freely modified without interrupting the traversal. However, if a parent of the visited item is modified, the traversal must be immediately stopped by returning a non-zero value.
|
inline |
Constructor.
This constructor can be used with CV_FAST, CV_PARENTS combined with CV_POST, CV_ONLYINS
|
inlinevirtual |
|
inline |
Should the parent information by maintained?
|
inline |
Should the traversal skip the children of the current item?
|
inline |
Should the traversal restart?
|
inline |
Should the leave...() functions be called?
|
inline |
Should all expressions be automatically pruned?
|
inline |
Prune children.
This function may be called by a visitor() to skip all children of the current item.
|
inline |
Do not prune children. This is an internal function, no need to call it.
|
inline |
Restart the travesal. Meaningful only in apply_to_exprs()
|
inline |
Do not restart. This is an internal function, no need to call it.
Traverse ctree.
The traversal will start at the specified item and continue until of one the visit_...() functions return a non-zero value.
item | root of the ctree to traverse |
parent | parent of the specified item. can be specified as nullptr. |
Traverse only expressions.
The traversal will start at the specified item and continue until of one the visit_...() functions return a non-zero value.
item | root of the ctree to traverse |
parent | parent of the specified item. can be specified as nullptr. |
|
inline |
Get parent of the current item as an item (statement or expression)
|
inline |
Get parent of the current item as an expression.
|
inline |
Get parent of the current item as a statement.
|
inlinevirtual |
Visit a statement.
This is a visitor function which should be overridden by a derived class to do some useful work. This visitor performs pre-order traserval, i.e. an item is visited before its children.
|
inlinevirtual |
Visit an expression.
This is a visitor function which should be overridden by a derived class to do some useful work. This visitor performs pre-order traserval, i.e. an item is visited before its children.
|
inlinevirtual |
Visit a statement after having visited its children.
This is a visitor function which should be overridden by a derived class to do some useful work. This visitor performs post-order traserval, i.e. an item is visited after its children.
|
inlinevirtual |
Visit an expression after having visited its children.
This is a visitor function which should be overridden by a derived class to do some useful work. This visitor performs post-order traserval, i.e. an item is visited after its children.
int ctree_visitor_t::cv_flags |
parents_t ctree_visitor_t::parents |
Vector of parents of the current item.
cblock_posvec_t ctree_visitor_t::bposvec |
Vector of block positions.
Only cit_block and cit_try parents have the corresponding element in this vector.