1 #ifndef ROSE_CodeGen_Factory_H
2 #define ROSE_CodeGen_Factory_H
4 #include <Rose/CodeGen/API.h>
6 namespace Rose {
namespace CodeGen {
17 template <
typename CRT,
typename API>
28 template <
typename CRT,
typename apiT, Object otag>
31 using tplargs_t = std::vector<SgTemplateArgument *>;
33 template <
typename CRT,
typename API>
60 template <
Object otag,
typename... Args>
64 ROSE_ASSERT(is_template_symbol_variant<otag>(sym->variantT()));
81 template <
Object otag,
typename... Args>
86 if (is_template_symbol_variant<otag>(sym->variantT())) {
88 ROSE_ASSERT(decl !=
nullptr);
89 sym =
dynamic_cast<symbol_t<otag> *
>(decl->search_for_symbol_from_symbol_table());
90 ROSE_ASSERT(sym !=
nullptr);
112 template <
Object otag,
typename... Args>
117 bool lhs_has_ptr_type = isSgPointerType(parent->
get_type());
118 if (lhs_has_ptr_type) {
123 ROSE_ASSERT(xtype !=
nullptr);
126 ROSE_ASSERT(rhs !=
nullptr);
128 if (lhs_has_ptr_type) {
143 template <Object otag>
144 using access_return_t = std::conditional_t<otag == Object::a_class || otag == Object::a_typedef, SgType, SgExpression>;
159 template <
Object otag,
typename... Args>
168 template <
typename CRT,
typename apiT>
170 reference_t<Object::a_variable> * Factory<CRT,apiT>::reference<Object::a_variable>(symbol_t<Object::a_variable> * sym) {
177 #include "Rose/CodeGen/factory/namespaces.txx"
178 #include "Rose/CodeGen/factory/classes.txx"
179 #include "Rose/CodeGen/factory/typedefs.txx"
180 #include "Rose/CodeGen/factory/variables.txx"
181 #include "Rose/CodeGen/factory/functions.txx"
constructs expressions and types for the given API
This class represents the base class for all types.
access_return_t< otag > * access(symbol_t< otag > *API::*obj, SgNamedType *parent, Args...args) const
Build expression or type to access static member and subtype of the parent type.
typename object_helper< otag >::symbol_t symbol_t
The SgSymbol specialization for an Object kind /tparam otag an Object kind.
virtual SgType * get_type() const
unparsing support for pragmas
permits to gather types and symbols to extract an API from a set of headers.
Main namespace for the ROSE library.
facilitates the manipulation of source-files (esp.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes, since similar to statement, expressions have a concrete location within the user's source code.
Object
The five kind of objects manipulated by Rose::CodeGen::API and associated Rose::CodeGen::Factory.
reference_t< otag > * reference(symbol_t< otag > *API::*obj, SgNamedType *parent, Args...args) const
Return an expression or type referencing the object.
enables partial specializations w.r.t the template parameter otag
typename object_helper< otag >::decl_t declaration_t
The SgDeclarationStatement specialization for an Object kind /tparam otag an Object kind...
SgExpression * access(symbol_t< otag > *API::*obj, SgExpression *parent, Args...args) const
Build expression to access a member of the parent expression.
ROSE_DLL_API SgArrowExp * buildArrowExp(SgExpression *lhs=NULL, SgExpression *rhs=NULL)
ROSE_DLL_API SgDotExp * buildDotExp(SgExpression *lhs=NULL, SgExpression *rhs=NULL)
declaration_t< otag > * instantiate(symbol_t< otag > *API::*obj, SgNamedType *parent, Args...args) const
Return an instantiation.
typename object_helper< otag >::ref_t reference_t
The SgReference specialization for an Object kind /tparam otag an Object kind.
std::conditional_t< otag==Object::a_class||otag==Object::a_typedef, SgType, SgExpression > access_return_t
Select return type for access based on Object type.