ROSE  0.11.96.11
Classes | Namespaces | Macros | Functions
sageGeneric.h File Reference
#include <type_traits>
#include <typeinfo>
#include <sstream>
Include dependency graph for sageGeneric.h:

Go to the source code of this file.

Classes

struct  sg::ConstLike< T1, T2 >
 projects the constness of T1 on T2 More...
 
struct  sg::ConstLike< const T1, T2 >
 
struct  sg::DispatchHandler< _ReturnType >
 struct DispatchHandler More...
 
struct  sg::VisitDispatcher< RoseVisitor >
 
struct  sg::DefaultHandler< SageNode >
 struct DefaultHandler More...
 
struct  sg::AncestorTypeFinder< AncestorNode, QualSgNode >
 helper class for _ancestor More...
 
struct  sg::TraversalFunction< SageNode >
 executes a functor for a specific node type More...
 
struct  sg::TraversalClass< GVisitor >
 
struct  sg::DispatchHelper< GVisitor >
 

Namespaces

 sg
 This namespace contains template functions that operate on the ROSE AST.
 

Macros

#define WITH_BINARY_NODES   0
 
#define WITH_UNTYPED_NODES   0
 
#define SG_UNEXPECTED_NODE(X)   (sg::unexpected_node(X, __FILE__, __LINE__))
 
#define SG_DEREF(X)   (sg::deref(X, __FILE__, __LINE__))
 
#define SG_ASSERT_TYPE(SAGENODE, N)   (sg::assert_sage_type<SAGENODE>(N, __FILE__, __LINE__))
 
#define SG_ERROR_IF(COND, MSG)   (sg::report_error_if(COND, MSG, __FILE__, __LINE__))
 
#define GEN_VISIT(X)   void visit(X * n) { rv.handle(*n); }
 

Functions

void sg::report_error (std::string desc, const char *file=nullptr, size_t ln=0)
 
void sg::unexpected_node (const SgNode &n, const char *file=nullptr, size_t ln=0)
 
template<class T >
T & sg::deref (T *ptr, const char *file=0, size_t ln=0)
 dereferences an object (= checked dereference in debug mode)
 
template<class RoseVisitor >
std::remove_const< typename std::remove_reference< RoseVisitor >::type >::type sg::_dispatch (RoseVisitor &&rv, SgNode *n)
 
template<class RoseVisitor >
std::remove_const< typename std::remove_reference< RoseVisitor >::type >::type sg::dispatch (RoseVisitor &&rv, SgNode *n)
 uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor. More...
 
template<class RoseVisitor >
std::remove_const< typename std::remove_reference< RoseVisitor >::type >::type sg::dispatch (RoseVisitor &&rv, const SgNode *n)
 
template<class AncestorNode , class QualSgNode >
AncestorNode * sg::_ancestor (QualSgNode &n)
 implements the ancestor search More...
 
template<class AncestorNode >
AncestorNode * sg::ancestor (SgNode *n)
 finds an ancestor node with a given type More...
 
template<class AncestorNode >
const AncestorNode * sg::ancestor (const SgNode *n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class AncestorNode >
AncestorNode & sg::ancestor (SgNode &n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class AncestorNode >
const AncestorNode & sg::ancestor (const SgNode &n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class SageNode , class SageChild >
void sg::swap_child (SageNode &lhs, SageNode &rhs, SageChild *(SageNode::*getter)() const, void(SageNode::*setter)(SageChild *))
 swaps children (of equal kind) between two ancestor nodes of the same type More...
 
template<class SageParent , class SageChild >
void sg::linkParentChild (SageParent &parent, SageChild &child, void(SageParent::*setter)(SageChild *))
 
template<class SageNode >
SageNode * sg::assert_sage_type (SgNode *n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
const SageNode * sg::assert_sage_type (const SgNode *n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
SageNode & sg::assert_sage_type (SgNode &n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
const SageNode & sg::assert_sage_type (const SgNode &n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
SageNode::base_node_type & sg::asBaseType (SageNode &n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
const SageNode::base_node_type & sg::asBaseType (const SageNode &n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
SageNode::base_node_type * sg::asBaseType (SageNode *n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
const SageNode::base_node_type * sg::asBaseType (const SageNode *n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
SageNode * sg::assert_sage_type (SgNode *n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
const SageNode * sg::assert_sage_type (const SgNode *n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
SageNode & sg::assert_sage_type (SgNode &n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
const SageNode & sg::assert_sage_type (const SgNode &n, const char *f=0, size_t ln=0)
 asserts that n has type SageNode More...
 
template<class SageNode >
SageNode::base_node_type & sg::asBaseType (SageNode &n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
const SageNode::base_node_type & sg::asBaseType (const SageNode &n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
SageNode::base_node_type * sg::asBaseType (SageNode *n)
 returns the same node n upcasted to its base type More...
 
template<class SageNode >
const SageNode::base_node_type * sg::asBaseType (const SageNode *n)
 returns the same node n upcasted to its base type More...
 

Detailed Description

This file implements generic (template) sage query functions Currently this includes functions for:

Definition in file sageGeneric.h.