44 template <
class T1,
class T2>
50 template <
class T1,
class T2>
65 std::cerr <<
typeid(n).
name() << std::endl;
69 throw std::logic_error(
"Encountered unexpected sage node. Please send a bug report to the maintainer.");
75 template <
class _ReturnType>
101 template <
class SageNode>
105 return static_cast<SageNode&
>(n);
110 template <
class SageNode>
114 return static_cast<const SageNode&
>(n);
122 template <
class SageNode>
135 template <
class SageNode>
144 template <
class RoseVisitor,
class SageNode>
153 switch (n->variantT())
2787 template <
class RoseVisitor>
2796 template <
class RoseVisitor>
2804 template <
class SageNode>
2817 template <
class AncestorNode,
class QualSgNode>
2821 typedef std::pair<AncestorNode*, QualSgNode*>
Pair;
2841 template <
class AncestorNode,
class QualSgNode>
2846 typename AncestorFinder::Pair res(NULL, n.get_parent());
2848 while (res.second != NULL)
2867 template <
class AncestorNode>
2870 if (n == NULL)
return NULL;
2872 return _ancestor<AncestorNode>(*n);
2876 template <
class AncestorNode>
2879 if (n == NULL)
return NULL;
2881 return _ancestor<const AncestorNode>(*n);
2885 template <
class AncestorNode>
2888 AncestorNode* res = _ancestor<AncestorNode>(n);
2895 template <
class AncestorNode>
2898 const AncestorNode* res = _ancestor<const AncestorNode>(n);
2904 template <
class SageNode>
2918 operator SageNode* () {
return res; }
2928 template <
class SageNode>
2935 template <
class SageNode>
2965 template <
class SageNode,
class SageChild>
2966 void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) ()
const,
void (SageNode::*setter) (SageChild*))
2968 SageChild* lhs_child = (lhs.*getter)();
2969 SageChild* rhs_child = (rhs.*getter)();
2970 ROSE_ASSERT(lhs_child && rhs_child);
2972 (lhs.*setter)(rhs_child);
2973 (rhs.*setter)(lhs_child);