12#include "sageInterface.h"
13#include "sageBuilder.h"
20 template <
class SageNode>
22 SageNode* cloneNode(
const SageNode* n)
52 template <
class ScopedSageNode>
53 void handle(ScopedSageNode* scopeElem)
const
55 ROSE_ASSERT(scopeElem);
57 scopeElem->set_scope(&scope);
60 void operator()(
SgStatement* scopeElem)
const { handle(scopeElem); }
90 : scope(enclosing_scope)
95 SgInitializer* copy_init = cloneNode(orig->get_initializer());
98 res->set_scope(scope);
112 template <
class SageSequenceContainer>
113 struct SageInserter : std::iterator<std::output_iterator_tag, void, void, void, void>
115 typedef SageSequenceContainer Container;
117 Container& container;
125 template <
class SageElem>
128 _append(container, elem);
139 template <
class SageSequenceContainer>
This class represents the concept of a declaration statement.
This class represents the concept of a C and C++ expression list.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents the concept of a declaration list.
This class represents the notion of a declared variable.
This class represents the notion of an initializer for a variable declaration or expression in a func...
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 variable refernece in expressions.
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 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...
NodeType * deepCopy(const NodeType *subtree)
A template function for deep copying a subtree. It is also used to create deepcopy functions with spe...
ROSE_DLL_API SgVariableSymbol * appendArg(SgFunctionParameterList *, SgInitializedName *)
Append an argument to SgFunctionParameterList, transparently set parent,scope, and symbols for argume...
ROSE_DLL_API void appendExpression(SgExprListExp *, SgExpression *)
Append an expression to a SgExprListExp, set the parent pointer also.
SageInserter< SageSequenceContainer > sage_inserter(SageSequenceContainer &cont)
generates a SageInserter, adding elements at the end of a sequence
Functor copying an initialized name into a different scope.
Generic inserter for sage containers.
Functor setting the scope of a sage node to a specified (at Functor construction time) scope.
Functor building a variable reference from an initialized name.