ROSE  0.11.145.0
Public Types | Public Member Functions | Public Attributes | Protected Types | List of all members
Rose::CodeGen::Factory< CRT, API > Class Template Reference

Description

template<typename CRT, typename API>
class Rose::CodeGen::Factory< CRT, API >

constructs expressions and types for the given API

Template Parameters
CRThttps://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
APIa specialization of Rose::CodeGen::API

Definition at line 18 of file Factory.h.

#include <Rose/CodeGen/Factory.h>

Collaboration diagram for Rose::CodeGen::Factory< CRT, API >:
Collaboration graph
[legend]

Public Types

using factory_t = Factory< CRT, API >
 

Public Member Functions

 Factory (Driver &driver_)
 
template<Object otag, typename... Args>
declaration_t< otag > * instantiate (symbol_t< otag > *API::*obj, SgNamedType *parent, Args...args) const
 Return an instantiation. More...
 
template<Object otag, typename... Args>
reference_t< otag > * reference (symbol_t< otag > *API::*obj, SgNamedType *parent, Args...args) const
 Return an expression or type referencing the object. More...
 
template<Object otag, typename... Args>
SgExpressionaccess (symbol_t< otag > *API::*obj, SgExpression *parent, Args...args) const
 Build expression to access a member of the parent expression. More...
 
template<Object otag, typename... Args>
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. More...
 

Public Attributes

Driverdriver
 
API api
 

Protected Types

template<Object otag>
using access_return_t = std::conditional_t< otag==Object::a_class||otag==Object::a_typedef, SgType, SgExpression >
 Select return type for access based on Object type. More...
 

Member Typedef Documentation

template<typename CRT , typename API >
template<Object otag>
using Rose::CodeGen::Factory< CRT, API >::access_return_t = std::conditional_t<otag == Object::a_class || otag == Object::a_typedef, SgType, SgExpression>
protected

Select return type for access based on Object type.

Template Parameters
otagmust be one of a_class/a_typedef or a_variable/a_function

Definition at line 144 of file Factory.h.

Member Function Documentation

template<typename CRT , typename API >
template<Object otag, typename... Args>
declaration_t<otag>* Rose::CodeGen::Factory< CRT, API >::instantiate ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Return an instantiation.

Template Parameters
otagmust be one of a_class/a_typedef/a_variable/a_function
Argstypes of the nodes to use as template arguments (SgType/SgExpression for type/non-type respectively
Parameters
objmust points to a template symbol
argsnodes to use as template arguments
parentis used when called by reference which was called by one of the access methods
Returns
a template instantiation

Definition at line 61 of file Factory.h.

template<typename CRT , typename API >
template<Object otag, typename... Args>
reference_t<otag>* Rose::CodeGen::Factory< CRT, API >::reference ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Return an expression or type referencing the object.

Args are forwarded to instantiate as needed.

Template Parameters
otagmust be one of a_class/a_typedef/a_variable/a_function
Argstypes of template arguments (see instantiate)
Parameters
objpoints to a symbol
argstemplate arguments (see instantiate)
parentis used when called by one of the access methods
Returns
a reference expression

Definition at line 82 of file Factory.h.

Referenced by Rose::CodeGen::Factory< CRT, API >::access().

template<typename CRT , typename API >
template<Object otag, typename... Args>
SgExpression* Rose::CodeGen::Factory< CRT, API >::access ( symbol_t< otag > *API::*  obj,
SgExpression parent,
Args...  args 
) const
inline

Build expression to access a member of the parent expression.

Args are forwarded to instantiate as needed.

Template Parameters
otagmust be one of a_variable/a_function
Argstypes of template arguments (see instantiate)
Parameters
objpoints to a symbol
parent
argstemplate arguments (see instantiate)
Returns
either . or -> operator with parent as lhs and reference(obj, args...) as rhs

Definition at line 113 of file Factory.h.

References SageBuilder::buildArrowExp(), SageBuilder::buildDotExp(), SgExpression::get_type(), and Rose::CodeGen::Factory< CRT, API >::reference().

template<typename CRT , typename API >
template<Object otag, typename... Args>
access_return_t<otag>* Rose::CodeGen::Factory< CRT, API >::access ( symbol_t< otag > *API::*  obj,
SgNamedType parent,
Args...  args 
) const
inline

Build expression or type to access static member and subtype of the parent type.

Args are forwarded to instantiate as needed.

Template Parameters
otagmust be one of a_class/a_typedef or a_variable/a_function
Argstypes of template arguments (see instantiate)
Parameters
objpoints to a symbol
lhs
argstemplate arguments (see instantiate)

Definition at line 160 of file Factory.h.

References Rose::CodeGen::Factory< CRT, API >::reference().


The documentation for this class was generated from the following file: