Typedefs | Functions

opennwa::traverse::details Namespace Reference

Typedefs

typedef
ConstCallStringStateFunctor::CallString 
CallString
typedef std::set< std::pair
< Symbol, State > > 
SymbolStatePairSet

Functions

void handle_internals (Nwa const &nwa, CallString const &cs, State state, StateSet &visited, ConstCallStringStateFunctor *state_functor, ConstCallStringTransitionFunctor *trans_functor, StateSet &return_sites)
void handle_calls (Nwa const &nwa, CallString const &cs, State state, StateSet &visited, ConstCallStringStateFunctor *state_functor, ConstCallStringTransitionFunctor *trans_functor, StateSet &return_sites)
void handle_returns (Nwa const &nwa, CallString const &cs, State state, ConstCallStringTransitionFunctor *trans_functor, StateSet &return_sites)
StateSet dfsCallStringTraversalHelper (Nwa const &nwa, CallString const &cs, State state, StateSet &visited_in_this_procedure, ConstCallStringStateFunctor *state_functor, ConstCallStringTransitionFunctor *trans_functor)
 Performs a depth-first traversal of the transition graph of 'nwa', starting from 'state'.

Typedef Documentation


Function Documentation

void opennwa::traverse::details::handle_internals ( Nwa const &  nwa,
CallString const &  cs,
State  state,
StateSet &  visited,
ConstCallStringStateFunctor *  state_functor,
ConstCallStringTransitionFunctor *  trans_functor,
StateSet &  return_sites 
)
void opennwa::traverse::details::handle_calls ( Nwa const &  nwa,
CallString const &  cs,
State  state,
StateSet &  visited,
ConstCallStringStateFunctor *  state_functor,
ConstCallStringTransitionFunctor *  trans_functor,
StateSet &  return_sites 
)
void opennwa::traverse::details::handle_returns ( Nwa const &  nwa,
CallString const &  cs,
State  state,
ConstCallStringTransitionFunctor *  trans_functor,
StateSet &  return_sites 
)
StateSet opennwa::traverse::details::dfsCallStringTraversalHelper ( Nwa const &  nwa,
CallString const &  cs,
State  state,
StateSet &  visited_in_this_procedure,
ConstCallStringStateFunctor *  state_functor,
ConstCallStringTransitionFunctor *  trans_functor 
)

Performs a depth-first traversal of the transition graph of 'nwa', starting from 'state'.

Returns the set of return nodes from the current "procedure".

When it reaches a call transition, for the next recursive call it pushes 'state' onto the call string. When it reaches a return transition, it compares the call predecessor on that transition to the actual call site on the top of the call string. If it matches, then the return site of that transition is added to the return set. If it does not match, it is discarded.

If 'state_functor' is non-null, calls it for each new state. If 'trans_functor' is set, calls it for each transition in the expanded nw.

References handle_calls(), handle_internals(), and handle_returns().

Referenced by handle_calls(), and handle_internals().