Go to the documentation of this file.
2 #ifndef _SAGEFUNCTORS_H
3 #define _SAGEFUNCTORS_H
12 #include "sageInterface.h"
13 #include "sageBuilder.h"
19 template <
class SageNode>
21 SageNode* cloneNode(
const SageNode* n)
51 template <
class ScopedSageNode>
52 void handle(ScopedSageNode* scopeElem)
const
54 ROSE_ASSERT(scopeElem);
56 scopeElem->set_scope(&scope);
59 void operator()(
SgStatement* scopeElem)
const { handle(scopeElem); }
89 : scope(enclosing_scope)
94 SgInitializer* copy_init = cloneNode(orig->get_initializer());
97 res->set_scope(scope);
111 template <
class SageSequenceContainer>
112 struct SageInserter : std::iterator<std::output_iterator_tag, void, void, void, void>
114 typedef SageSequenceContainer Container;
116 Container& container;
124 template <
class SageElem>
127 _append(container, elem);
138 template <
class SageSequenceContainer>
Functor setting the scope of a sage node to a specified (at Functor construction time) scope.
NodeType * deepCopy(const NodeType *subtree)
A template function for deep copying a subtree. It is also used to create deepcopy functions with spe...
Functor copying an initialized name into a different scope.
This class represents the variable refernece in expressions.
This class represents the concept of a C and C++ expression list.
Generic inserter for sage containers.
SageInserter< SageSequenceContainer > sage_inserter(SageSequenceContainer &cont)
generates a SageInserter, adding elements at the end of a sequence
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents the concept of a declaration list.
ROSE_DLL_API void appendExpression(SgExprListExp *, SgExpression *)
Append an expression to a SgExprListExp, set the parent pointer also.
This class represents the concept of a declaration statement.
ROSE_DLL_API SgVarRefExp * buildVarRefExp(const SgName &name, SgScopeStatement *scope=NULL)
Build SgVarRefExp based on a variable's Sage name. It will lookup the name in the symbol table intern...
ROSE_DLL_API SgInitializedName * buildInitializedName(const SgName &name, SgType *type, SgInitializer *init=NULL)
Initialized names are tricky, their scope vary depending on context, so scope and symbol information ...
ROSE_DLL_API SgVariableSymbol * appendArg(SgFunctionParameterList *, SgInitializedName *)
Append an argument to SgFunctionParameterList, transparently set parent,scope, and symbols for argume...
This class represents the notion of a declared variable.
This namespace contains template functions that operate on the ROSE AST.
Functor building a variable reference from an initialized name.
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the notion of a statement.
This class represents the notion of an initializer for a variable declaration or expression in a func...