Public Member Functions | List of all members
ctree_parentee_t Struct Reference

A helper ctree traversal class that maintains parent information. More...

Inheritance diagram for ctree_parentee_t:
ctree_visitor_t cfunc_parentee_t

Public Member Functions

 ctree_parentee_t (bool post=false)
 
bool recalc_parent_types (void)
 Recalculate types of parent node. More...
 
- Public Member Functions inherited from ctree_visitor_t
bool maintain_parents (void) const
 Should the parent information by maintained?
 
bool must_prune (void) const
 Should the traversal skip the children of the current item?
 
bool must_restart (void) const
 Should the traversal restart?
 
bool is_postorder (void) const
 Should the leave...() functions be called?
 
bool only_insns (void) const
 Should all expressions be automatically pruned?
 
void prune_now (void)
 Prune children. More...
 
void clr_prune (void)
 Do not prune children. This is an internal function, no need to call it.
 
void set_restart (void)
 Restart the travesal. Meaningful only in apply_to_exprs()
 
void clr_restart (void)
 Do not restart. This is an internal function, no need to call it.
 
 ctree_visitor_t (int _flags)
 Constructor. More...
 
 DEFINE_VIRTUAL_DTOR (ctree_visitor_t)
 
int apply_to (citem_t *item, citem_t *parent)
 Traverse ctree. More...
 
int apply_to_exprs (citem_t *item, citem_t *parent)
 Traverse only expressions. More...
 
cexpr_tparent_expr (void)
 Get parent of the current item as an expression.
 
cinsn_tparent_insn (void)
 Get parent of the current item as a statement.
 
virtual int visit_insn (cinsn_t *)
 Visit a statement. More...
 
virtual int visit_expr (cexpr_t *)
 Visit an expression. More...
 
virtual int leave_insn (cinsn_t *)
 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. More...
 
virtual int leave_expr (cexpr_t *)
 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. More...
 

Additional Inherited Members

- Public Attributes inherited from ctree_visitor_t
int cv_flags
 Ctree visitor property bits
 
parents_t parents
 Vector of parents of the current item.
 

Detailed Description

A helper ctree traversal class that maintains parent information.

Examples:
hexrays_sample5.cpp.

Definition at line 1450 of file hexrays.hpp.

Member Function Documentation

bool ctree_parentee_t::recalc_parent_types ( void  )

Recalculate types of parent node.

If a node type has been changed, the visitor must recalculate all parent types, otherwise the ctree becomes inconsistent. If during this recalculation a parent node is added/deleted, this function returns true. In this case it is recommended to restart the traversal because the information about parent nodes is stale.

Returns
false-ok to continue the traversal, true-must stop.

Definition at line 4898 of file hexrays.hpp.

References hexdsp.